diff --git a/books/bookvol10.3.pamphlet b/books/bookvol10.3.pamphlet index 508767b..919003f 100644 --- a/books/bookvol10.3.pamphlet +++ b/books/bookvol10.3.pamphlet @@ -5166,6 +5166,411 @@ Asp9(name): Exports == Implementation where @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain JORDAN AssociatedJordanAlgebra} +\pagehead{AssociatedJordanAlgebra}{JORDAN} +\pagepic{ps/v103associatedjordanalgebra.ps}{JORDAN}{1.00} +See also:\\ +\refto{AssociatedLieAlgebra}{LIE} +\refto{LieSquareMatrix}{LSQM} +<>= +)abbrev domain JORDAN AssociatedJordanAlgebra +++ Author: J. Grabmeier +++ Date Created: 14 June 1991 +++ Date Last Updated: 14 June 1991 +++ Basic Operations: *,**,+,- +++ Related Constructors: +++ Also See: +++ AMS Classifications: +++ Keywords: associated Jordan algebra +++ References: +++ Description: +++ AssociatedJordanAlgebra takes an algebra \spad{A} and uses \spadfun{*$A} +++ to define the new multiplications \spad{a*b := (a *$A b + b *$A a)/2} +++ (anticommutator). +++ The usual notation \spad{{a,b}_+} cannot be used due to +++ restrictions in the current language. +++ This domain only gives a Jordan algebra if the +++ Jordan-identity \spad{(a*b)*c + (b*c)*a + (c*a)*b = 0} holds +++ for all \spad{a},\spad{b},\spad{c} in \spad{A}. +++ This relation can be checked by +++ \spadfun{jordanAdmissible?()$A}. +++ +++ If the underlying algebra is of type +++ \spadtype{FramedNonAssociativeAlgebra(R)} (i.e. a non +++ associative algebra over R which is a free R-module of finite +++ rank, together with a fixed R-module basis), then the same +++ is true for the associated Jordan algebra. +++ Moreover, if the underlying algebra is of type +++ \spadtype{FiniteRankNonAssociativeAlgebra(R)} (i.e. a non +++ associative algebra over R which is a free R-module of finite +++ rank), then the same true for the associated Jordan algebra. + +AssociatedJordanAlgebra(R:CommutativeRing,A:NonAssociativeAlgebra R): + public == private where + public ==> Join (NonAssociativeAlgebra R, CoercibleTo A) with + coerce : A -> % + ++ coerce(a) coerces the element \spad{a} of the algebra \spad{A} + ++ to an element of the Jordan algebra + ++ \spadtype{AssociatedJordanAlgebra}(R,A). + if A has FramedNonAssociativeAlgebra(R) then _ + FramedNonAssociativeAlgebra(R) + if A has FiniteRankNonAssociativeAlgebra(R) then _ + FiniteRankNonAssociativeAlgebra(R) + + private ==> A add + Rep := A + two : R := (1$R + 1$R) + oneHalf : R := (recip two) :: R + (a:%) * (b:%) == + zero? two => error + "constructor must no be called with Ring of characteristic 2" + ((a::Rep) * $Rep (b::Rep) +$Rep (b::Rep) * $Rep (a::Rep)) * oneHalf + -- (a::Rep) * $Rep (b::Rep) +$Rep (b::Rep) * $Rep (a::Rep) + coerce(a:%):A == a :: Rep + coerce(a:A):% == a :: % + (a:%) ** (n:PositiveInteger) == a + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain LIE AssociatedLieAlgebra} +\pagehead{AssociatedLieAlgebra}{LIE} +\pagepic{ps/v103associatedliealgebra.ps}{LIE}{1.00} +See also:\\ +\refto{AssociatedJordanAlgebra}{JORDAN} +\refto{LieSquareMatrix}{LSQM} +<>= +)abbrev domain LIE AssociatedLieAlgebra +++ Author: J. Grabmeier +++ Date Created: 07 March 1991 +++ Date Last Updated: 14 June 1991 +++ Basic Operations: *,**,+,- +++ Related Constructors: +++ Also See: +++ AMS Classifications: +++ Keywords: associated Liealgebra +++ References: +++ Description: +++ AssociatedLieAlgebra takes an algebra \spad{A} +++ and uses \spadfun{*$A} to define the +++ Lie bracket \spad{a*b := (a *$A b - b *$A a)} (commutator). Note that +++ the notation \spad{[a,b]} cannot be used due to +++ restrictions of the current compiler. +++ This domain only gives a Lie algebra if the +++ Jacobi-identity \spad{(a*b)*c + (b*c)*a + (c*a)*b = 0} holds +++ for all \spad{a},\spad{b},\spad{c} in \spad{A}. +++ This relation can be checked by +++ \spad{lieAdmissible?()$A}. +++ +++ If the underlying algebra is of type +++ \spadtype{FramedNonAssociativeAlgebra(R)} (i.e. a non +++ associative algebra over R which is a free \spad{R}-module of finite +++ rank, together with a fixed \spad{R}-module basis), then the same +++ is true for the associated Lie algebra. +++ Also, if the underlying algebra is of type +++ \spadtype{FiniteRankNonAssociativeAlgebra(R)} (i.e. a non +++ associative algebra over R which is a free R-module of finite +++ rank), then the same is true for the associated Lie algebra. + +AssociatedLieAlgebra(R:CommutativeRing,A:NonAssociativeAlgebra R): + public == private where + public ==> Join (NonAssociativeAlgebra R, CoercibleTo A) with + coerce : A -> % + ++ coerce(a) coerces the element \spad{a} of the algebra \spad{A} + ++ to an element of the Lie + ++ algebra \spadtype{AssociatedLieAlgebra}(R,A). + if A has FramedNonAssociativeAlgebra(R) then + FramedNonAssociativeAlgebra(R) + if A has FiniteRankNonAssociativeAlgebra(R) then + FiniteRankNonAssociativeAlgebra(R) + + private ==> A add + Rep := A + (a:%) * (b:%) == (a::Rep) * $Rep (b::Rep) -$Rep (b::Rep) * $Rep (a::Rep) + coerce(a:%):A == a :: Rep + coerce(a:A):% == a :: % + (a:%) ** (n:PositiveInteger) == + n = 1 => a + 0 + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain ALIST AssociationList} +<>= +-- list.spad.pamphlet AssociationList.input +)spool AssociationList.output +)set message test on +)set message auto off +)clear all +--S 1 of 10 +Data := Record(monthsOld : Integer, gender : String) +--R +--R +--R (1) Record(monthsOld: Integer,gender: String) +--R Type: Domain +--E 1 + +--S 2 of 10 +al : AssociationList(String,Data) +--R +--R Type: Void +--E 2 + +--S 3 of 10 +al := table() +--R +--R +--R (3) table() +--R Type: AssociationList(String,Record(monthsOld: Integer,gender: String)) +--E 3 + +--S 4 of 10 +al."bob" := [407,"male"]$Data +--R +--R +--R (4) [monthsOld= 407,gender= "male"] +--R Type: Record(monthsOld: Integer,gender: String) +--E 4 + +--S 5 of 10 +al."judith" := [366,"female"]$Data +--R +--R +--R (5) [monthsOld= 366,gender= "female"] +--R Type: Record(monthsOld: Integer,gender: String) +--E 5 + +--S 6 of 10 +al."katie" := [24,"female"]$Data +--R +--R +--R (6) [monthsOld= 24,gender= "female"] +--R Type: Record(monthsOld: Integer,gender: String) +--E 6 + +--S 7 of 10 +al."smokie" := [200,"female"]$Data +--R +--R +--R (7) [monthsOld= 200,gender= "female"] +--R Type: Record(monthsOld: Integer,gender: String) +--E 7 + +--S 8 of 10 +al +--R +--R +--R (8) +--R table +--R "smokie"= [monthsOld= 200,gender= "female"] +--R , +--R "katie"= [monthsOld= 24,gender= "female"] +--R , +--R "judith"= [monthsOld= 366,gender= "female"] +--R , +--R "bob"= [monthsOld= 407,gender= "male"] +--R Type: AssociationList(String,Record(monthsOld: Integer,gender: String)) +--E 8 + +--S 9 of 10 +al."katie" := [23,"female"]$Data +--R +--R +--R (9) [monthsOld= 23,gender= "female"] +--R Type: Record(monthsOld: Integer,gender: String) +--E 9 + +--S 10 of 10 +delete!(al,1) +--R +--R +--R (10) +--R table +--R "katie"= [monthsOld= 23,gender= "female"] +--R , +--R "judith"= [monthsOld= 366,gender= "female"] +--R , +--R "bob"= [monthsOld= 407,gender= "male"] +--R Type: AssociationList(String,Record(monthsOld: Integer,gender: String)) +--E 10 +)spool +)lisp (bye) +@ +<>= +==================================================================== +AssociationList examples +==================================================================== + +The AssociationList constructor provides a general structure for +associative storage. This type provides association lists in which +data objects can be saved according to keys of any type. For a given +association list, specific types must be chosen for the keys and +entries. You can think of the representation of an association list +as a list of records with key and entry fields. + +Association lists are a form of table and so most of the operations +available for Table are also available for AssociationList. They can +also be viewed as lists and can be manipulated accordingly. + +This is a Record type with age and gender fields. + + Data := Record(monthsOld : Integer, gender : String) + Record(monthsOld: Integer,gender: String) + Type: Domain + +In this expression, al is declared to be an association +list whose keys are strings and whose entries are the above records. + + al : AssociationList(String,Data) + Type: Void + +The table operation is used to create an empty association list. + + al := table() + table() + Type: AssociationList(String,Record(monthsOld: Integer,gender: String)) + +You can use assignment syntax to add things to the association list. + + al."bob" := [407,"male"]$Data + [monthsOld=407, gender= "male"] + Type: Record(monthsOld: Integer,gender: String) + + al."judith" := [366,"female"]$Data + [monthsOld=366, gender= "female"] + Type: Record(monthsOld: Integer,gender: String) + + al."katie" := [24,"female"]$Data + [monthsOld=24, gender= "female"] + Type: Record(monthsOld: Integer,gender: String) + +Perhaps we should have included a species field. + + al."smokie" := [200,"female"]$Data + [monthsOld=200, gender= "female"] + Type: Record(monthsOld: Integer,gender: String) + +Now look at what is in the association list. Note that the last-added +(key, entry) pair is at the beginning of the list. + + al + table("smokie" = [monthsOld=200, gender= "female"], + "katie" = [monthsOld=24, gender= "female"], + "judith" = [monthsOld=366, gender= "female"], + "bob" = [monthsOld=407, gender= "male"]) + Type: AssociationList(String,Record(monthsOld: Integer,gender: String)) + +You can reset the entry for an existing key. + + al."katie" := [23,"female"]$Data + [monthsOld=23, gender= "female"] + Type: Record(monthsOld: Integer,gender: String) + +Use delete! to destructively remove an element of the association +list. Use delete to return a copy of the association list with the +element deleted. The second argument is the index of the element to +delete. + + delete!(al,1) + table("katie" = [monthsOld=23, gender= "female"], + "judith" = [monthsOld=366, gender= "female"], + "bob" = [monthsOld=407, gender= "male"]) + Type: AssociationList(String,Record(monthsOld: Integer,gender: String)) + +See Also: +o )help Table +o )help List +o )show AssociationList +o $AXIOM/doc/src/algebra/list.spad.dvi + +@ +\pagehead{AssociationList}{ALIST} +\pagepic{ps/v103associationlist.ps}{ALIST}{1.00} +See also:\\ +\refto{IndexedList}{ILIST} +\refto{List}{LIST} +<>= +)abbrev domain ALIST AssociationList +++ Author: +++ Date Created: +++ Change History: +++ Basic Operations: empty, empty?, keys, \#, concat, first, rest, +++ setrest!, search, setelt, remove! +++ Related Constructors: +++ Also See: List +++ AMS Classification: +++ Keywords: list, association list +++ Description: +++ \spadtype{AssociationList} implements association lists. These +++ may be viewed as lists of pairs where the first part is a key +++ and the second is the stored value. For example, the key might +++ be a string with a persons employee identification number and +++ the value might be a record with personnel data. + +AssociationList(Key:SetCategory, Entry:SetCategory): + AssociationListAggregate(Key, Entry) == add + Pair ==> Record(key:Key, entry:Entry) + Rep := Reference List Pair + + dictionary() == ref empty() + empty() == dictionary() + empty? t == empty? deref t + entries(t:%):List(Pair) == deref t + parts(t:%):List(Pair) == deref t + keys t == [k.key for k in deref t] + # t == # deref t + first(t:%):Pair == first deref t + rest t == ref rest deref t + concat(p:Pair, t:%) == ref concat(p, deref t) + setrest_!(a:%, b:%) == ref setrest_!(deref a, deref b) + setfirst_!(a:%, p:Pair) == setfirst_!(deref a,p) + minIndex(a:%):Integer == minIndex(deref a) + maxIndex(a:%):Integer == maxIndex(deref a) + + search(k, t) == + for r in deref t repeat + k = r.key => return(r.entry) + "failed" + + latex(a : %) : String == + l : List Pair := entries a + s : String := "\left[" + while not empty?(l) repeat + r : Pair := first l + l := rest l + s := concat(s, concat(latex r.key, concat(" = ", latex r.entry)$String)$String)$String + if not empty?(l) then s := concat(s, ", ")$String + concat(s, " \right]")$String + +-- assoc(k, l) == +-- (r := find(#1.key=k, l)) case "failed" => "failed" +-- r + + assoc(k, t) == + for r in deref t repeat + k = r.key => return r + "failed" + + setelt(t:%, k:Key, e:Entry) == + (r := assoc(k, t)) case Pair => (r::Pair).entry := e + setref(t, concat([k, e], deref t)) + e + + remove_!(k:Key, t:%) == + empty?(l := deref t) => "failed" + k = first(l).key => + setref(t, rest l) + first(l).entry + prev := l + curr := rest l + while not empty? curr and first(curr).key ^= k repeat + prev := curr + curr := rest curr + empty? curr => "failed" + setrest_!(prev, rest curr) + first(curr).entry + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Chapter B} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain BFUNCT BasicFunctions} @@ -5999,1027 +6404,6 @@ CardinalNumber: Join(OrderedSet, AbelianMonoid, Monoid, @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{domain CLIF CliffordAlgebra\cite{7,12}} -\subsection{Vector (linear) spaces} -This information is originally from Paul Leopardi's presentation on -the {\sl Introduction to Clifford Algebras} and is included here as -an outline with his permission. Further details are based on the book -by Doran and Lasenby called {\sl Geometric Algebra for Physicists}. - -Consider the various kinds of products that can occur between vectors. -There are scalar and vector products from 3D geometry. There are the -complex and quaterion products. There is also -the {\sl outer} or {\sl exterior} product. - -Vector addition commutes: -\[a + b = b + a\] -Vector addtion is associative: -\[a + (b + c) = (a + b) + c\] -The identity vector exists: -\[a + 0 = a\] -Every vector has an inverse: -\[a + (-a) = 0\] - -If we consider vectors to be directed line segments, thus establishing -a geometric meaning for a vector, then each of these properties has a -geometric meaning. - -A multiplication operator exists between scalars and vectors with -the properties: -\[\lambda(a + b) = \lambda a + \lambda b\] -\[(\lambda + \mu)a = \lambda a + \mu a\] -\[(\lambda\mu)a = \lambda(\mu a)\] -\[{\rm If\ }1\lambda = \lambda{\rm\ for\ all\ scalars\ }\lambda -{\rm\ then\ }1a=a{\rm\ for\ all\ vectors\ }a\] - -These properties completely define a vector (linear) space. The -$+$ operation for scalar arithmetic is not the same as the $+$ -operation for vectors. - -{\bf Definition: Isomorphic} The vector space $A$ is isomorphic to -the vector space $B$ if their exists a one-to-one correspondence -between their elements which preserves sums and there is a one-to-one -correspondence between the scalars which preserves sums and products. - -{\bf Definition: Subspace} Vector space $B$ is a subspace of vector -space $A$ if all of the elements of $B$ are contained in $A$ and -they share the same scalars. - -{\bf Definition: Linear Combination} Given vectors $a_1,\ldots,a_n$ -the vector $b$ is a linear combination of the vectors if we can find -scalars $\lambda_i$ such that -\[b = \lambda_1 a_1+\ldots+\lambda_n a_n = \sum_{k=1}^n \lambda_i a_i\] - -{\bf Definition: Linearly Independent} If there exists scalars $\lambda_i$ -such that -\[\lambda_1 a_1 + \ldots + \lambda_n a_n = 0\] -and at least one of the $\lambda_i$ is not zero -then the vectors $a_1,\ldots,a_n$ are linearly dependent. If no such -scalars exist then the vectors are linearly independent. - -{\bf Definition: Span} If every vector can be written as a linear -combination of a fixed set of vectors $a_1,\ldots,a_n$ then this set -of vectors is said to span the vector space. - -{\bf Definition: Basis} If a set of vectors $a_1,\ldots,a_n$ is linearly -independent and spans a vector space $A$ then the vectors form a basis -for $A$. - -{\bf Definition: Dimension} The dimension of a vector space is the -number of basis elements, which is unique since all bases of a -vector space have the same number of elements. -\subsection{Quadratic Forms\cite{1}} -For vector space $\mathbb{V}$ over field $\mathbb{F}$, characteristic -$\ne 2$: -\begin{list}{} -\item Map $f:\mathbb{V} \rightarrow \mathbb{F}$, with -$$f(\lambda x)=\lambda^2f(x),\forall \lambda \in \mathbb{F}, x \in \mathbb{V}$$ -\item $f(x) = b(x,x)$, where -$$b:\mathbb{V}{\rm\ x\ }\mathbb{V} \rightarrow \mathbb{F}{\rm\ ,given\ by\ }$$ -$$b(x,y):=\frac{1}{2}(f(x+y)-f(x)=f(y))$$ -is a symmetric bilinear form -\end{list} -\subsection{Quadratic spaces, Clifford Maps\cite{1,2}} -\begin{list}{} -\item A quadratic space is the pair($\mathbb{V}$,$f$), where $f$ is a -quadratic form on $\mathbb{V}$ -\item A Clifford map is a vector space homomorphism -$$\rho : \mathbb{V} \rightarrow \mathbb{A}$$ -where $\mathbb{A}$ is an associated algebra, and -$$(\rho v)^2 = f(v),{\rm\ \ \ } \forall v \in \mathbb{V}$$ -\end{list} -\subsection{Universal Clifford algebras\cite{1}} -\begin{list}{} -\item The {\sl universal Clifford algebra} $Cl(f)$ for the quadratic space -$(\mathbb{V},f)$ is the algebra generated by the image of the Clifford -map $\phi_f$ such that $Cl(f)$ is the universal initial object such -that $\forall$ suitable algebra $\mathbb{A}$ with Clifford map -$\phi_{\mathbb{A}} \exists$ a homomorphism -$$P_\mathbb{A}:Cl(f) \rightarrow \mathbb{A}$$ -$$\rho_\mathbb{A} = P_\mathbb{A}\circ\rho_f$$ -\end{list} -\subsection{Real Clifford algebras $\mathbb{R}_{p,q}$\cite{2}} -\begin{list}{} -\item The real quadratic space $\mathbb{R}^{p,q}$ is $\mathbb{R}^{p+q}$ with -$$\phi(x):=-\sum_{k:=-q}^{-1}{x_k^2}+\sum_{k=1}^p{x_k^2}$$ -\item For each $p,q \in \mathbb{N}$, the real universal Clifford algebra -for $\mathbb{R}^{p,q}$ is called $\mathbb{R}_{p,q}$ -\item $\mathbb{R}_{p,q}$ is isomorphic to some matrix algebra over one of: -$\mathbb{R}$,$\mathbb{R}\oplus\mathbb{R}$,$\mathbb{C}$, -$\mathbb{H}$,$\mathbb{H}\oplus\mathbb{H}$ -\item For example, $\mathbb{R}_{1,1} \cong \mathbb{R}(2)$ -\end{list} -\subsection{Notation for integer sets} -\begin{list}{} -\item For $S \subseteq \mathbb{Z}$, define -$$\sum_{k \in S}{f_k}:=\sum_{k={\rm min\ }S, k \in S}^{{\rm max\ } S}{f_k}$$ -$$\prod_{k \in S}{f_k}:=\prod_{k={\rm min\ }S, k \in S}^{{\rm max\ } S}{f_k}$$ -$$\mathbb{P}(S):={\rm\ the\ }\ power\ set\ {\rm\ of\ }S$$ -\item For $m \le n \in \mathbb{Z}$, define -$$\zeta(m,n):=\{m,m+1,\ldots,n-1,n\}\backslash\{0\}$$ -\end{list} -\subsection{Frames for Clifford algebras\cite{9,10,11}} -\begin{list}{} -\item A {\sl frame} is an ordered basis $(\gamma_{-q},\ldots,\gamma_p)$ -for $\mathbb{R}^{p,q}$ which puts a quadratic form into the canonical -form $\phi$ -\item For $p,q \in \mathbb{N}$, embed the frame for $\mathbb{R}^{p,q}$ -into $\mathbb{R}_{p,q}$ via the maps -$$\gamma:\zeta(-q,p) \rightarrow \mathbb{R}^{p,q}$$ -$$\rho:\mathbb{R}^{p,q} \rightarrow \mathbb{R}_{p,q}$$ -$$(\rho\gamma k)^2 = \phi\gamma k = {\rm\ sgn\ }k$$ -\end{list} -\subsection{Real frame groups\cite{5,6}} -\begin{list}{} -\item For $p,q \in \mathbb{N}$, define the real {\sl frame group} $\mathbb{G}_{p,q}$ -via the map -$$g:\zeta(-q,p) \rightarrow \mathbb{G}_{p,q}$$ -with generators and relations -$$\langle \mu,g_k | \mu g_k = g_k \mu,{\rm\ \ \ }\mu^2 = 1,$$ -$$(g_k)^2 = -\left\{ -\begin{array}{lcc} -\mu,&{\rm\ \ }&{\rm\ if\ }k < 0\\ -1&{\rm\ \ }&{\rm\ if\ }k > 0 -\end{array} -\right.$$ -$$g_kg_m = \mu g_mg_k{\rm\ \ \ }\forall k \ne m\rangle$$ -\end{list} -\subsection{Canonical products\cite{1,3,4}} -\begin{list}{} -\item The real frame group $\mathbb{G}_{p,q}$ has order $2^{p+q+1}$ -\item Each member $w$ can be expressed as the canonically ordered product -$$w=\mu^a\prod_{k \in T}{g_k}$$ -$$\ =\mu^a\prod_{k=-q,k\ne0}^p{g_k^{b_k}}$$ -where $T \subseteq \zeta(-q,p),a,b_k \in \{0,1\}$ -\end{list} -\subsection{Clifford algebra of frame group\cite{1,4,5,6}} -\begin{list}{} -\item For $p,q \in \mathbb{N}$ embed $\mathbb{G}_{p,q}$ into -$\mathbb{R}_{p,q}$ via the map -$$\alpha \mathbb{G}_{p,q} \rightarrow \mathbb{R}_{p,q}$$ -$$\alpha 1 := 1,{\rm\ \ \ \ \ } \alpha\mu := -1$$ -$$\alpha g_k := \rho\gamma_k, {\rm \ \ \ \ \ } -\alpha(gh) := (\alpha g)(\alpha h)$$ -\item Define {\sl basis elements} via the map -$$e:\mathbb{P}\zeta(-q,p) \rightarrow \mathbb{R}_{p,q}, -{\rm \ \ \ \ \ }e_T := \alpha \prod_{k \in T}{g_k}$$ -\item Each $a \in \mathbb{R}_{p,q}$ can be expressed as -$$a = \sum_{T \subseteq \zeta(-q,p)}{a_T e_T}$$ -\end{list} -\subsection{Neutral matrix representations\cite{1,2,8}} -The {\sl representation map} $P_m$ and {\sl representation matrix} $R_m$ -make the following diagram commute: -\begin{tabular}{ccc} - & coord & \\ -$\mathbb{R}_{m,m}$ & --------$>$ & $\mathbb{R}^{4^m}$ \\ - $|$ & & $|$ \\ - $|$ & & $|$ \\ - $P_m$ & & $R_m$ \\ - $|$ & & $|$ \\ - $|$ & & $|$ \\ - V & & V \\ - $\mathbb{R}(2^m)$ & --------$>$ & $\mathbb{R}^{4^m}$\\ - & reshape & \\ -\end{tabular} -<>= --- clifford.spad.pamphlet CliffordAlgebra.input -)spool CliffordAlgebra.output -)set message test on -)set message auto off -)clear all ---S 1 of 36 -K := Fraction Polynomial Integer ---R ---R ---R (1) Fraction Polynomial Integer ---R Type: Domain ---E 1 - ---S 2 of 36 -m := matrix [ [-1] ] ---R ---R ---R (2) [- 1] ---R Type: Matrix Integer ---E 2 - ---S 3 of 36 -C := CliffordAlgebra(1, K, quadraticForm m) ---R ---R ---R (3) CliffordAlgebra(1,Fraction Polynomial Integer,MATRIX) ---R Type: Domain ---E 3 - ---S 4 of 36 -i: C := e(1) ---R ---R ---R (4) e ---R 1 ---R Type: CliffordAlgebra(1,Fraction Polynomial Integer,MATRIX) ---E 4 - ---S 5 of 36 -x := a + b * i ---R ---R ---R (5) a + b e ---R 1 ---R Type: CliffordAlgebra(1,Fraction Polynomial Integer,MATRIX) ---E 5 - ---S 6 of 36 -y := c + d * i ---R ---R ---R (6) c + d e ---R 1 ---R Type: CliffordAlgebra(1,Fraction Polynomial Integer,MATRIX) ---E 6 - ---S 7 of 36 -x * y ---R ---R ---R (7) - b d + a c + (a d + b c)e ---R 1 ---R Type: CliffordAlgebra(1,Fraction Polynomial Integer,MATRIX) ---E 7 -)clear all - ---S 8 of 36 -K := Fraction Polynomial Integer ---R ---R ---R (1) Fraction Polynomial Integer ---R Type: Domain ---E 8 - ---S 9 of 36 -m := matrix [ [-1,0],[0,-1] ] ---R ---R ---R +- 1 0 + ---R (2) | | ---R + 0 - 1+ ---R Type: Matrix Integer ---E 9 - ---S 10 of 36 -H := CliffordAlgebra(2, K, quadraticForm m) ---R ---R ---R (3) CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) ---R Type: Domain ---E 10 - ---S 11 of 36 -i: H := e(1) ---R ---R ---R (4) e ---R 1 ---R Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) ---E 11 - ---S 12 of 36 -j: H := e(2) ---R ---R ---R (5) e ---R 2 ---R Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) ---E 12 - ---S 13 of 36 -k: H := i * j ---R ---R ---R (6) e e ---R 1 2 ---R Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) ---E 13 - ---S 14 of 36 -x := a + b * i + c * j + d * k ---R ---R ---R (7) a + b e + c e + d e e ---R 1 2 1 2 ---R Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) ---E 14 - ---S 15 of 36 -y := e + f * i + g * j + h * k ---R ---R ---R (8) e + f e + g e + h e e ---R 1 2 1 2 ---R Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) ---E 15 - ---S 16 of 36 -x + y ---R ---R ---R (9) e + a + (f + b)e + (g + c)e + (h + d)e e ---R 1 2 1 2 ---R Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) ---E 16 - ---S 17 of 36 -x * y ---R ---R ---R (10) ---R - d h - c g - b f + a e + (c h - d g + a f + b e)e ---R 1 ---R + ---R (- b h + a g + d f + c e)e + (a h + b g - c f + d e)e e ---R 2 1 2 ---R Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) ---E 17 - ---S 18 of 36 -y * x ---R ---R ---R (11) ---R - d h - c g - b f + a e + (- c h + d g + a f + b e)e ---R 1 ---R + ---R (b h + a g - d f + c e)e + (a h - b g + c f + d e)e e ---R 2 1 2 ---R Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) ---E 18 -)clear all - ---S 19 of 36 -K := Fraction Polynomial Integer ---R ---R ---R (1) Fraction Polynomial Integer ---R Type: Domain ---E 19 - ---S 20 of 36 -Ext := CliffordAlgebra(3, K, quadraticForm 0) ---R ---R ---R (2) CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) ---R Type: Domain ---E 20 - ---S 21 of 36 -i: Ext := e(1) ---R ---R ---R (3) e ---R 1 ---R Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) ---E 21 - ---S 22 of 36 -j: Ext := e(2) ---R ---R ---R (4) e ---R 2 ---R Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) ---E 22 - ---S 23 of 36 -k: Ext := e(3) ---R ---R ---R (5) e ---R 3 ---R Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) ---E 23 - ---S 24 of 36 -x := x1*i + x2*j + x3*k ---R ---R ---R (6) x1 e + x2 e + x3 e ---R 1 2 3 ---R Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) ---E 24 - ---S 25 of 36 -y := y1*i + y2*j + y3*k ---R ---R ---R (7) y1 e + y2 e + y3 e ---R 1 2 3 ---R Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) ---E 25 - ---S 26 of 36 -x + y ---R ---R ---R (8) (y1 + x1)e + (y2 + x2)e + (y3 + x3)e ---R 1 2 3 ---R Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) ---E 26 - ---S 27 of 36 -x * y + y * x ---R ---R ---R (9) 0 ---R Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) ---E 27 - ---S 28 of 36 -dual2 a == coefficient(a,[2,3]) * i + coefficient(a,[3,1]) * j + coefficient(a,[1,2]) * k ---R ---R Type: Void ---E 28 - ---S 29 of 36 -dual2(x*y) ---R ---R Compiling function dual2 with type CliffordAlgebra(3,Fraction ---R Polynomial Integer,MATRIX) -> CliffordAlgebra(3,Fraction ---R Polynomial Integer,MATRIX) ---R ---R (11) (x2 y3 - x3 y2)e + (- x1 y3 + x3 y1)e + (x1 y2 - x2 y1)e ---R 1 2 3 ---R Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) ---E 29 -)clear all - ---S 30 of 36 -K := Fraction Integer ---R ---R ---R (1) Fraction Integer ---R Type: Domain ---E 30 - ---S 31 of 36 -g := matrix [ [1,0,0,0], [0,-1,0,0], [0,0,-1,0], [0,0,0,-1] ] ---R ---R ---R +1 0 0 0 + ---R | | ---R |0 - 1 0 0 | ---R (2) | | ---R |0 0 - 1 0 | ---R | | ---R +0 0 0 - 1+ ---R Type: Matrix Integer ---E 31 - ---S 32 of 36 -D := CliffordAlgebra(4,K, quadraticForm g) ---R ---R ---R (3) CliffordAlgebra(4,Fraction Integer,MATRIX) ---R Type: Domain ---E 32 - ---S 33 of 36 -gam := [e(i)$D for i in 1..4] ---R ---R ---R (4) [e ,e ,e ,e ] ---R 1 2 3 4 ---R Type: List CliffordAlgebra(4,Fraction Integer,MATRIX) ---E 33 - ---S 34 of 36 -m := 1; n:= 2; r := 3; s := 4; ---R ---R ---R Type: PositiveInteger ---E 34 - ---S 35 of 36 -lhs := reduce(+, [reduce(+, [ g(l,t)*gam(l)*gam(m)*gam(n)*gam(r)*gam(s)*gam(t) for l in 1..4]) for t in 1..4]) ---R ---R ---R (6) - 4e e e e ---R 1 2 3 4 ---R Type: CliffordAlgebra(4,Fraction Integer,MATRIX) ---E 35 - ---S 36 of 36 -rhs := 2*(gam s * gam m*gam n*gam r + gam r*gam n*gam m*gam s) ---R ---R ---R (7) - 4e e e e ---R 1 2 3 4 ---R Type: CliffordAlgebra(4,Fraction Integer,MATRIX) ---E 36 -)spool -)lisp (bye) -@ -<>= -==================================================================== -CliffordAlgebra examples -==================================================================== - -CliffordAlgebra(n,K,Q) defines a vector space of dimension 2^n over -the field K with a given quadratic form Q. If {e1..en} is a basis for -K^n then - - -{ 1, - e(i) 1 <= i <= n, - e(i1)*e(i2) 1 <= i1 < i2 <=n, - ..., - e(1)*e(2)*...*e(n) } - -is a basis for the Clifford algebra. The algebra is defined by the relations - - e(i)*e(i) = Q(e(i)) - e(i)*e(j) = -e(j)*e(i), for i ^= j - -Examples of Clifford Algebras are gaussians (complex numbers), -quaternions, exterior algebras and spin algebras. - -==================================================================== -The Complex Numbers as a Clifford Algebra -==================================================================== - -This is the field over which we will work, rational functions with -integer coefficients. - - K := Fraction Polynomial Integer - Fraction Polynomial Integer - Type: Domain - -We use this matrix for the quadratic form. - - m := matrix [ [-1] ] - [- 1] - Type: Matrix Integer - -We get complex arithmetic by using this domain. - - C := CliffordAlgebra(1, K, quadraticForm m) - CliffordAlgebra(1,Fraction Polynomial Integer,MATRIX) - Type: Domain - -Here is i, the usual square root of -1. - - i: C := e(1) - e - 1 - Type: CliffordAlgebra(1,Fraction Polynomial Integer,MATRIX) - -Here are some examples of the arithmetic. - - x := a + b * i - a + b e - 1 - Type: CliffordAlgebra(1,Fraction Polynomial Integer,MATRIX) - - y := c + d * i - c + d e - 1 - Type: CliffordAlgebra(1,Fraction Polynomial Integer,MATRIX) - - x * y - - b d + a c + (a d + b c)e - 1 - Type: CliffordAlgebra(1,Fraction Polynomial Integer,MATRIX) - -==================================================================== -The Quaternion Numbers as a Clifford Algebra -==================================================================== - -This is the field over which we will work, rational functions with -integer coefficients. - - K := Fraction Polynomial Integer - Fraction Polynomial Integer - Type: Domain - -We use this matrix for the quadratic form. - - m := matrix [ [-1,0],[0,-1] ] - +- 1 0 + - | | - + 0 - 1+ - Type: Matrix Integer - -The resulting domain is the quaternions. - - H := CliffordAlgebra(2, K, quadraticForm m) - CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) - Type: Domain - -We use Hamilton's notation for i, j, k. - - i: H := e(1) - e - 1 - Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) - - j: H := e(2) - e - 2 - Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) - - k: H := i * j - e e - 1 2 - Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) - - x := a + b * i + c * j + d * k - a + b e + c e + d e e - 1 2 1 2 - Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) - - y := e + f * i + g * j + h * k - e + f e + g e + h e e - 1 2 1 2 - Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) - - x + y - e + a + (f + b)e + (g + c)e + (h + d)e e - 1 2 1 2 - Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) - - x * y - - d h - c g - b f + a e + (c h - d g + a f + b e)e - 1 - + - (- b h + a g + d f + c e)e + (a h + b g - c f + d e)e e - 2 1 2 - Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) - - y * x - - d h - c g - b f + a e + (- c h + d g + a f + b e)e - 1 - + - (b h + a g - d f + c e)e + (a h - b g + c f + d e)e e - 2 1 2 - Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) - -==================================================================== -The Exterior Algebra on a Three Space -==================================================================== - -This is the field over which we will work, rational functions with -integer coefficients. - - K := Fraction Polynomial Integer - Fraction Polynomial Integer - Type: Domain - -If we chose the three by three zero quadratic form, we obtain -the exterior algebra on e(1),e(2),e(3). - - Ext := CliffordAlgebra(3, K, quadraticForm 0) - CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) - Type: Domain - -This is a three dimensional vector algebra. We define i, j, k as the -unit vectors. - - i: Ext := e(1) - e - 1 - Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) - - j: Ext := e(2) - e - 2 - Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) - - k: Ext := e(3) - e - 3 - Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) - -Now it is possible to do arithmetic. - - x := x1*i + x2*j + x3*k - x1 e + x2 e + x3 e - 1 2 3 - Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) - - y := y1*i + y2*j + y3*k - y1 e + y2 e + y3 e - 1 2 3 - Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) - - x + y - (y1 + x1)e + (y2 + x2)e + (y3 + x3)e - 1 2 3 - Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) - - x * y + y * x - 0 - Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) - -On an n space, a grade p form has a dual n-p form. In particular, in -three space the dual of a grade two element identifies - - e1*e2 -> e3, e2*e3 -> e1, e3*e1 -> e2. - - dual2 a == coefficient(a,[2,3]) * i + coefficient(a,[3,1]) * j + coefficient(a,[1,2]) * k - Type: Void - -The vector cross product is then given by this. - - dual2(x*y) - (x2 y3 - x3 y2)e + (- x1 y3 + x3 y1)e + (x1 y2 - x2 y1)e - 1 2 3 - Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) - -==================================================================== -The Dirac Spin Algebra -==================================================================== - -In this section we will work over the field of rational numbers. - - K := Fraction Integer - Fraction Integer - Type: Domain - -We define the quadratic form to be the Minkowski space-time metric. - - g := matrix [ [1,0,0,0], [0,-1,0,0], [0,0,-1,0], [0,0,0,-1] ] - +1 0 0 0 + - | | - |0 - 1 0 0 | - | | - |0 0 - 1 0 | - | | - +0 0 0 - 1+ - Type: Matrix Integer - -We obtain the Dirac spin algebra used in Relativistic Quantum Field Theory. - - D := CliffordAlgebra(4,K, quadraticForm g) - CliffordAlgebra(4,Fraction Integer,MATRIX) - Type: Domain - -The usual notation for the basis is gamma with a superscript. For -Axiom input we will use gam(i): - - gam := [e(i)$D for i in 1..4] - [e ,e ,e ,e ] - 1 2 3 4 - Type: List CliffordAlgebra(4,Fraction Integer,MATRIX) - -There are various contraction identities of the form - - g(l,t)*gam(l)*gam(m)*gam(n)*gam(r)*gam(s)*gam(t) = - 2*(gam(s)gam(m)gam(n)gam(r) + gam(r)*gam(n)*gam(m)*gam(s)) - -where a sum over l and t is implied. - -Verify this identity for particular values of m,n,r,s. - - m := 1; n:= 2; r := 3; s := 4; - Type: PositiveInteger - - lhs := reduce(+, [reduce(+, [ g(l,t)*gam(l)*gam(m)*gam(n)*gam(r)*gam(s)*gam(t) for l in 1..4]) for t in 1..4]) - - 4e e e e - 1 2 3 4 - Type: CliffordAlgebra(4,Fraction Integer,MATRIX) - - rhs := 2*(gam s * gam m*gam n*gam r + gam r*gam n*gam m*gam s) - - 4e e e e - 1 2 3 4 - Type: CliffordAlgebra(4,Fraction Integer,MATRIX) - -See Also: -o )help Complex -o )help Quaternion -o )show CliffordAlgebra -o $AXIOM/doc/src/algebra/clifford.spad - -@ -<>= -"CLIF" -> "RING" -"CliffordAlgebra(a:PositiveInteger,b:Field,c:QuadraticForm(a,b))" -> - "Ring()" -"CLIF" -> "ALGEBRA" -"CliffordAlgebra(a:PositiveInteger,b:Field,c:QuadraticForm(a,b))" -> - "Algebra(a:Field)" -"CLIF" -> "VSPACE" -"CliffordAlgebra(a:PositiveInteger,b:Field,c:QuadraticForm(a,b))" -> - "VectorSpace(a:Field)" -@ -\pagehead{CliffordAlgebra}{CLIF} -\pagepic{ps/v103cliffordalgebra.ps}{CLIF}{1.00} -See also:\\ -\refto{QuadraticForm}{QFORM} -<>= -)abbrev domain CLIF CliffordAlgebra -++ Author: Stephen M. Watt -++ Date Created: August 1988 -++ Date Last Updated: May 17, 1991 -++ Basic Operations: wholeRadix, fractRadix, wholeRagits, fractRagits -++ Related Domains: QuadraticForm, Quaternion, Complex -++ Also See: -++ AMS Classifications: -++ Keywords: clifford algebra, grassman algebra, spin algebra -++ Examples: -++ References: -++ -++ Description: -++ CliffordAlgebra(n, K, Q) defines a vector space of dimension \spad{2**n} -++ over K, given a quadratic form Q on \spad{K**n}. -++ -++ If \spad{e[i]}, \spad{1<=i<=n} is a basis for \spad{K**n} then -++ 1, \spad{e[i]} (\spad{1<=i<=n}), \spad{e[i1]*e[i2]} -++ (\spad{1<=i1 PositiveInteger - NNI==> NonNegativeInteger - - T ==> Join(Ring, Algebra(K), VectorSpace(K)) with - e: PI -> % - ++ e(n) produces the appropriate unit element. - monomial: (K, List PI) -> % - ++ monomial(c,[i1,i2,...,iN]) produces the value given by - ++ \spad{c*e(i1)*e(i2)*...*e(iN)}. - coefficient: (%, List PI) -> K - ++ coefficient(x,[i1,i2,...,iN]) extracts the coefficient of - ++ \spad{e(i1)*e(i2)*...*e(iN)} in x. - recip: % -> Union(%, "failed") - ++ recip(x) computes the multiplicative inverse of x or "failed" - ++ if x is not invertible. - - Impl ==> add - Qeelist := [Q unitVector(i::PositiveInteger) for i in 1..n] - dim := 2**n - - Rep := PrimitiveArray K - - New ==> new(dim, 0$K)$Rep - - x, y, z: % - c: K - m: Integer - - characteristic() == characteristic()$K - dimension() == dim::CardinalNumber - - x = y == - for i in 0..dim-1 repeat - if x.i ^= y.i then return false - true - - x + y == (z := New; for i in 0..dim-1 repeat z.i := x.i + y.i; z) - x - y == (z := New; for i in 0..dim-1 repeat z.i := x.i - y.i; z) - - x == (z := New; for i in 0..dim-1 repeat z.i := - x.i; z) - m * x == (z := New; for i in 0..dim-1 repeat z.i := m*x.i; z) - c * x == (z := New; for i in 0..dim-1 repeat z.i := c*x.i; z) - - 0 == New - 1 == (z := New; z.0 := 1; z) - coerce(m): % == (z := New; z.0 := m::K; z) - coerce(c): % == (z := New; z.0 := c; z) - - e b == - b::NNI > n => error "No such basis element" - iz := 2**((b-1)::NNI) - z := New; z.iz := 1; z - - -- The ei*ej products could instead be precomputed in - -- a (2**n)**2 multiplication table. - addMonomProd(c1: K, b1: NNI, c2: K, b2: NNI, z: %): % == - c := c1 * c2 - bz := b2 - for i in 0..n-1 | bit?(b1,i) repeat - -- Apply rule ei*ej = -ej*ei for i^=j - k := 0 - for j in i+1..n-1 | bit?(b1, j) repeat k := k+1 - for j in 0..i-1 | bit?(bz, j) repeat k := k+1 - if odd? k then c := -c - -- Apply rule ei**2 = Q(ei) - if bit?(bz,i) then - c := c * Qeelist.(i+1) - bz:= (bz - 2**i)::NNI - else - bz:= bz + 2**i - z.bz := z.bz + c - z - - x * y == - z := New - for ix in 0..dim-1 repeat - if x.ix ^= 0 then for iy in 0..dim-1 repeat - if y.iy ^= 0 then addMonomProd(x.ix,ix,y.iy,iy,z) - z - - canonMonom(c: K, lb: List PI): Record(coef: K, basel: NNI) == - -- 0. Check input - for b in lb repeat b > n => error "No such basis element" - - -- 1. Apply identity ei*ej = -ej*ei, i^=j. - -- The Rep assumes n is small so bubble sort is ok. - -- Using bubble sort keeps the exchange info obvious. - wasordered := false - exchanges := 0 - while not wasordered repeat - wasordered := true - for i in 1..#lb-1 repeat - if lb.i > lb.(i+1) then - t := lb.i; lb.i := lb.(i+1); lb.(i+1) := t - exchanges := exchanges + 1 - wasordered := false - if odd? exchanges then c := -c - - -- 2. Prepare the basis element - -- Apply identity ei*ei = Q(ei). - bz := 0 - for b in lb repeat - bn := (b-1)::NNI - if bit?(bz, bn) then - c := c * Qeelist bn - bz:= ( bz - 2**bn )::NNI - else - bz:= bz + 2**bn - [c, bz::NNI] - - monomial(c, lb) == - r := canonMonom(c, lb) - z := New - z r.basel := r.coef - z - coefficient(z, lb) == - r := canonMonom(1, lb) - r.coef = 0 => error "Cannot take coef of 0" - z r.basel/r.coef - - Ex ==> OutputForm - - coerceMonom(c: K, b: NNI): Ex == - b = 0 => c::Ex - ml := [sub("e"::Ex, i::Ex) for i in 1..n | bit?(b,i-1)] - be := reduce("*", ml) - c = 1 => be - c::Ex * be - coerce(x): Ex == - tl := [coerceMonom(x.i,i) for i in 0..dim-1 | x.i^=0] - null tl => "0"::Ex - reduce("+", tl) - - - localPowerSets(j:NNI): List(List(PI)) == - l: List List PI := list [] - j = 0 => l - Sm := localPowerSets((j-1)::NNI) - Sn: List List PI := [] - for x in Sm repeat Sn := cons(cons(j pretend PI, x),Sn) - append(Sn, Sm) - - powerSets(j:NNI):List List PI == map(reverse, localPowerSets j) - - Pn:List List PI := powerSets(n) - - recip(x: %): Union(%, "failed") == - one:% := 1 - -- tmp:c := x*yC - 1$C - rhsEqs : List K := [] - lhsEqs: List List K := [] - lhsEqi: List K - for pi in Pn repeat - rhsEqs := cons(coefficient(one, pi), rhsEqs) - - lhsEqi := [] - for pj in Pn repeat - lhsEqi := cons(coefficient(x*monomial(1,pj),pi),lhsEqi) - lhsEqs := cons(reverse(lhsEqi),lhsEqs) - ans := particularSolution(matrix(lhsEqs), - vector(rhsEqs))$LinearSystemMatrixPackage(K, Vector K, Vector K, Matrix K) - ans case "failed" => "failed" - ansP := parts(ans) - ansC:% := 0 - for pj in Pn repeat - cj:= first ansP - ansP := rest ansP - ansC := ansC + cj*monomial(1,pj) - ansC - -@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain CARTEN CartesianTensor} <>= -- carten.spad.pamphlet CartesianTensor.input @@ -8586,6 +7970,1027 @@ CartesianTensor(minix, dim, R): Exports == Implementation where @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain CLIF CliffordAlgebra\cite{7,12}} +\subsection{Vector (linear) spaces} +This information is originally from Paul Leopardi's presentation on +the {\sl Introduction to Clifford Algebras} and is included here as +an outline with his permission. Further details are based on the book +by Doran and Lasenby called {\sl Geometric Algebra for Physicists}. + +Consider the various kinds of products that can occur between vectors. +There are scalar and vector products from 3D geometry. There are the +complex and quaterion products. There is also +the {\sl outer} or {\sl exterior} product. + +Vector addition commutes: +\[a + b = b + a\] +Vector addtion is associative: +\[a + (b + c) = (a + b) + c\] +The identity vector exists: +\[a + 0 = a\] +Every vector has an inverse: +\[a + (-a) = 0\] + +If we consider vectors to be directed line segments, thus establishing +a geometric meaning for a vector, then each of these properties has a +geometric meaning. + +A multiplication operator exists between scalars and vectors with +the properties: +\[\lambda(a + b) = \lambda a + \lambda b\] +\[(\lambda + \mu)a = \lambda a + \mu a\] +\[(\lambda\mu)a = \lambda(\mu a)\] +\[{\rm If\ }1\lambda = \lambda{\rm\ for\ all\ scalars\ }\lambda +{\rm\ then\ }1a=a{\rm\ for\ all\ vectors\ }a\] + +These properties completely define a vector (linear) space. The +$+$ operation for scalar arithmetic is not the same as the $+$ +operation for vectors. + +{\bf Definition: Isomorphic} The vector space $A$ is isomorphic to +the vector space $B$ if their exists a one-to-one correspondence +between their elements which preserves sums and there is a one-to-one +correspondence between the scalars which preserves sums and products. + +{\bf Definition: Subspace} Vector space $B$ is a subspace of vector +space $A$ if all of the elements of $B$ are contained in $A$ and +they share the same scalars. + +{\bf Definition: Linear Combination} Given vectors $a_1,\ldots,a_n$ +the vector $b$ is a linear combination of the vectors if we can find +scalars $\lambda_i$ such that +\[b = \lambda_1 a_1+\ldots+\lambda_n a_n = \sum_{k=1}^n \lambda_i a_i\] + +{\bf Definition: Linearly Independent} If there exists scalars $\lambda_i$ +such that +\[\lambda_1 a_1 + \ldots + \lambda_n a_n = 0\] +and at least one of the $\lambda_i$ is not zero +then the vectors $a_1,\ldots,a_n$ are linearly dependent. If no such +scalars exist then the vectors are linearly independent. + +{\bf Definition: Span} If every vector can be written as a linear +combination of a fixed set of vectors $a_1,\ldots,a_n$ then this set +of vectors is said to span the vector space. + +{\bf Definition: Basis} If a set of vectors $a_1,\ldots,a_n$ is linearly +independent and spans a vector space $A$ then the vectors form a basis +for $A$. + +{\bf Definition: Dimension} The dimension of a vector space is the +number of basis elements, which is unique since all bases of a +vector space have the same number of elements. +\subsection{Quadratic Forms\cite{1}} +For vector space $\mathbb{V}$ over field $\mathbb{F}$, characteristic +$\ne 2$: +\begin{list}{} +\item Map $f:\mathbb{V} \rightarrow \mathbb{F}$, with +$$f(\lambda x)=\lambda^2f(x),\forall \lambda \in \mathbb{F}, x \in \mathbb{V}$$ +\item $f(x) = b(x,x)$, where +$$b:\mathbb{V}{\rm\ x\ }\mathbb{V} \rightarrow \mathbb{F}{\rm\ ,given\ by\ }$$ +$$b(x,y):=\frac{1}{2}(f(x+y)-f(x)=f(y))$$ +is a symmetric bilinear form +\end{list} +\subsection{Quadratic spaces, Clifford Maps\cite{1,2}} +\begin{list}{} +\item A quadratic space is the pair($\mathbb{V}$,$f$), where $f$ is a +quadratic form on $\mathbb{V}$ +\item A Clifford map is a vector space homomorphism +$$\rho : \mathbb{V} \rightarrow \mathbb{A}$$ +where $\mathbb{A}$ is an associated algebra, and +$$(\rho v)^2 = f(v),{\rm\ \ \ } \forall v \in \mathbb{V}$$ +\end{list} +\subsection{Universal Clifford algebras\cite{1}} +\begin{list}{} +\item The {\sl universal Clifford algebra} $Cl(f)$ for the quadratic space +$(\mathbb{V},f)$ is the algebra generated by the image of the Clifford +map $\phi_f$ such that $Cl(f)$ is the universal initial object such +that $\forall$ suitable algebra $\mathbb{A}$ with Clifford map +$\phi_{\mathbb{A}} \exists$ a homomorphism +$$P_\mathbb{A}:Cl(f) \rightarrow \mathbb{A}$$ +$$\rho_\mathbb{A} = P_\mathbb{A}\circ\rho_f$$ +\end{list} +\subsection{Real Clifford algebras $\mathbb{R}_{p,q}$\cite{2}} +\begin{list}{} +\item The real quadratic space $\mathbb{R}^{p,q}$ is $\mathbb{R}^{p+q}$ with +$$\phi(x):=-\sum_{k:=-q}^{-1}{x_k^2}+\sum_{k=1}^p{x_k^2}$$ +\item For each $p,q \in \mathbb{N}$, the real universal Clifford algebra +for $\mathbb{R}^{p,q}$ is called $\mathbb{R}_{p,q}$ +\item $\mathbb{R}_{p,q}$ is isomorphic to some matrix algebra over one of: +$\mathbb{R}$,$\mathbb{R}\oplus\mathbb{R}$,$\mathbb{C}$, +$\mathbb{H}$,$\mathbb{H}\oplus\mathbb{H}$ +\item For example, $\mathbb{R}_{1,1} \cong \mathbb{R}(2)$ +\end{list} +\subsection{Notation for integer sets} +\begin{list}{} +\item For $S \subseteq \mathbb{Z}$, define +$$\sum_{k \in S}{f_k}:=\sum_{k={\rm min\ }S, k \in S}^{{\rm max\ } S}{f_k}$$ +$$\prod_{k \in S}{f_k}:=\prod_{k={\rm min\ }S, k \in S}^{{\rm max\ } S}{f_k}$$ +$$\mathbb{P}(S):={\rm\ the\ }\ power\ set\ {\rm\ of\ }S$$ +\item For $m \le n \in \mathbb{Z}$, define +$$\zeta(m,n):=\{m,m+1,\ldots,n-1,n\}\backslash\{0\}$$ +\end{list} +\subsection{Frames for Clifford algebras\cite{9,10,11}} +\begin{list}{} +\item A {\sl frame} is an ordered basis $(\gamma_{-q},\ldots,\gamma_p)$ +for $\mathbb{R}^{p,q}$ which puts a quadratic form into the canonical +form $\phi$ +\item For $p,q \in \mathbb{N}$, embed the frame for $\mathbb{R}^{p,q}$ +into $\mathbb{R}_{p,q}$ via the maps +$$\gamma:\zeta(-q,p) \rightarrow \mathbb{R}^{p,q}$$ +$$\rho:\mathbb{R}^{p,q} \rightarrow \mathbb{R}_{p,q}$$ +$$(\rho\gamma k)^2 = \phi\gamma k = {\rm\ sgn\ }k$$ +\end{list} +\subsection{Real frame groups\cite{5,6}} +\begin{list}{} +\item For $p,q \in \mathbb{N}$, define the real {\sl frame group} $\mathbb{G}_{p,q}$ +via the map +$$g:\zeta(-q,p) \rightarrow \mathbb{G}_{p,q}$$ +with generators and relations +$$\langle \mu,g_k | \mu g_k = g_k \mu,{\rm\ \ \ }\mu^2 = 1,$$ +$$(g_k)^2 = +\left\{ +\begin{array}{lcc} +\mu,&{\rm\ \ }&{\rm\ if\ }k < 0\\ +1&{\rm\ \ }&{\rm\ if\ }k > 0 +\end{array} +\right.$$ +$$g_kg_m = \mu g_mg_k{\rm\ \ \ }\forall k \ne m\rangle$$ +\end{list} +\subsection{Canonical products\cite{1,3,4}} +\begin{list}{} +\item The real frame group $\mathbb{G}_{p,q}$ has order $2^{p+q+1}$ +\item Each member $w$ can be expressed as the canonically ordered product +$$w=\mu^a\prod_{k \in T}{g_k}$$ +$$\ =\mu^a\prod_{k=-q,k\ne0}^p{g_k^{b_k}}$$ +where $T \subseteq \zeta(-q,p),a,b_k \in \{0,1\}$ +\end{list} +\subsection{Clifford algebra of frame group\cite{1,4,5,6}} +\begin{list}{} +\item For $p,q \in \mathbb{N}$ embed $\mathbb{G}_{p,q}$ into +$\mathbb{R}_{p,q}$ via the map +$$\alpha \mathbb{G}_{p,q} \rightarrow \mathbb{R}_{p,q}$$ +$$\alpha 1 := 1,{\rm\ \ \ \ \ } \alpha\mu := -1$$ +$$\alpha g_k := \rho\gamma_k, {\rm \ \ \ \ \ } +\alpha(gh) := (\alpha g)(\alpha h)$$ +\item Define {\sl basis elements} via the map +$$e:\mathbb{P}\zeta(-q,p) \rightarrow \mathbb{R}_{p,q}, +{\rm \ \ \ \ \ }e_T := \alpha \prod_{k \in T}{g_k}$$ +\item Each $a \in \mathbb{R}_{p,q}$ can be expressed as +$$a = \sum_{T \subseteq \zeta(-q,p)}{a_T e_T}$$ +\end{list} +\subsection{Neutral matrix representations\cite{1,2,8}} +The {\sl representation map} $P_m$ and {\sl representation matrix} $R_m$ +make the following diagram commute: +\begin{tabular}{ccc} + & coord & \\ +$\mathbb{R}_{m,m}$ & --------$>$ & $\mathbb{R}^{4^m}$ \\ + $|$ & & $|$ \\ + $|$ & & $|$ \\ + $P_m$ & & $R_m$ \\ + $|$ & & $|$ \\ + $|$ & & $|$ \\ + V & & V \\ + $\mathbb{R}(2^m)$ & --------$>$ & $\mathbb{R}^{4^m}$\\ + & reshape & \\ +\end{tabular} +<>= +-- clifford.spad.pamphlet CliffordAlgebra.input +)spool CliffordAlgebra.output +)set message test on +)set message auto off +)clear all +--S 1 of 36 +K := Fraction Polynomial Integer +--R +--R +--R (1) Fraction Polynomial Integer +--R Type: Domain +--E 1 + +--S 2 of 36 +m := matrix [ [-1] ] +--R +--R +--R (2) [- 1] +--R Type: Matrix Integer +--E 2 + +--S 3 of 36 +C := CliffordAlgebra(1, K, quadraticForm m) +--R +--R +--R (3) CliffordAlgebra(1,Fraction Polynomial Integer,MATRIX) +--R Type: Domain +--E 3 + +--S 4 of 36 +i: C := e(1) +--R +--R +--R (4) e +--R 1 +--R Type: CliffordAlgebra(1,Fraction Polynomial Integer,MATRIX) +--E 4 + +--S 5 of 36 +x := a + b * i +--R +--R +--R (5) a + b e +--R 1 +--R Type: CliffordAlgebra(1,Fraction Polynomial Integer,MATRIX) +--E 5 + +--S 6 of 36 +y := c + d * i +--R +--R +--R (6) c + d e +--R 1 +--R Type: CliffordAlgebra(1,Fraction Polynomial Integer,MATRIX) +--E 6 + +--S 7 of 36 +x * y +--R +--R +--R (7) - b d + a c + (a d + b c)e +--R 1 +--R Type: CliffordAlgebra(1,Fraction Polynomial Integer,MATRIX) +--E 7 +)clear all + +--S 8 of 36 +K := Fraction Polynomial Integer +--R +--R +--R (1) Fraction Polynomial Integer +--R Type: Domain +--E 8 + +--S 9 of 36 +m := matrix [ [-1,0],[0,-1] ] +--R +--R +--R +- 1 0 + +--R (2) | | +--R + 0 - 1+ +--R Type: Matrix Integer +--E 9 + +--S 10 of 36 +H := CliffordAlgebra(2, K, quadraticForm m) +--R +--R +--R (3) CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) +--R Type: Domain +--E 10 + +--S 11 of 36 +i: H := e(1) +--R +--R +--R (4) e +--R 1 +--R Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) +--E 11 + +--S 12 of 36 +j: H := e(2) +--R +--R +--R (5) e +--R 2 +--R Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) +--E 12 + +--S 13 of 36 +k: H := i * j +--R +--R +--R (6) e e +--R 1 2 +--R Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) +--E 13 + +--S 14 of 36 +x := a + b * i + c * j + d * k +--R +--R +--R (7) a + b e + c e + d e e +--R 1 2 1 2 +--R Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) +--E 14 + +--S 15 of 36 +y := e + f * i + g * j + h * k +--R +--R +--R (8) e + f e + g e + h e e +--R 1 2 1 2 +--R Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) +--E 15 + +--S 16 of 36 +x + y +--R +--R +--R (9) e + a + (f + b)e + (g + c)e + (h + d)e e +--R 1 2 1 2 +--R Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) +--E 16 + +--S 17 of 36 +x * y +--R +--R +--R (10) +--R - d h - c g - b f + a e + (c h - d g + a f + b e)e +--R 1 +--R + +--R (- b h + a g + d f + c e)e + (a h + b g - c f + d e)e e +--R 2 1 2 +--R Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) +--E 17 + +--S 18 of 36 +y * x +--R +--R +--R (11) +--R - d h - c g - b f + a e + (- c h + d g + a f + b e)e +--R 1 +--R + +--R (b h + a g - d f + c e)e + (a h - b g + c f + d e)e e +--R 2 1 2 +--R Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) +--E 18 +)clear all + +--S 19 of 36 +K := Fraction Polynomial Integer +--R +--R +--R (1) Fraction Polynomial Integer +--R Type: Domain +--E 19 + +--S 20 of 36 +Ext := CliffordAlgebra(3, K, quadraticForm 0) +--R +--R +--R (2) CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) +--R Type: Domain +--E 20 + +--S 21 of 36 +i: Ext := e(1) +--R +--R +--R (3) e +--R 1 +--R Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) +--E 21 + +--S 22 of 36 +j: Ext := e(2) +--R +--R +--R (4) e +--R 2 +--R Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) +--E 22 + +--S 23 of 36 +k: Ext := e(3) +--R +--R +--R (5) e +--R 3 +--R Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) +--E 23 + +--S 24 of 36 +x := x1*i + x2*j + x3*k +--R +--R +--R (6) x1 e + x2 e + x3 e +--R 1 2 3 +--R Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) +--E 24 + +--S 25 of 36 +y := y1*i + y2*j + y3*k +--R +--R +--R (7) y1 e + y2 e + y3 e +--R 1 2 3 +--R Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) +--E 25 + +--S 26 of 36 +x + y +--R +--R +--R (8) (y1 + x1)e + (y2 + x2)e + (y3 + x3)e +--R 1 2 3 +--R Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) +--E 26 + +--S 27 of 36 +x * y + y * x +--R +--R +--R (9) 0 +--R Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) +--E 27 + +--S 28 of 36 +dual2 a == coefficient(a,[2,3]) * i + coefficient(a,[3,1]) * j + coefficient(a,[1,2]) * k +--R +--R Type: Void +--E 28 + +--S 29 of 36 +dual2(x*y) +--R +--R Compiling function dual2 with type CliffordAlgebra(3,Fraction +--R Polynomial Integer,MATRIX) -> CliffordAlgebra(3,Fraction +--R Polynomial Integer,MATRIX) +--R +--R (11) (x2 y3 - x3 y2)e + (- x1 y3 + x3 y1)e + (x1 y2 - x2 y1)e +--R 1 2 3 +--R Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) +--E 29 +)clear all + +--S 30 of 36 +K := Fraction Integer +--R +--R +--R (1) Fraction Integer +--R Type: Domain +--E 30 + +--S 31 of 36 +g := matrix [ [1,0,0,0], [0,-1,0,0], [0,0,-1,0], [0,0,0,-1] ] +--R +--R +--R +1 0 0 0 + +--R | | +--R |0 - 1 0 0 | +--R (2) | | +--R |0 0 - 1 0 | +--R | | +--R +0 0 0 - 1+ +--R Type: Matrix Integer +--E 31 + +--S 32 of 36 +D := CliffordAlgebra(4,K, quadraticForm g) +--R +--R +--R (3) CliffordAlgebra(4,Fraction Integer,MATRIX) +--R Type: Domain +--E 32 + +--S 33 of 36 +gam := [e(i)$D for i in 1..4] +--R +--R +--R (4) [e ,e ,e ,e ] +--R 1 2 3 4 +--R Type: List CliffordAlgebra(4,Fraction Integer,MATRIX) +--E 33 + +--S 34 of 36 +m := 1; n:= 2; r := 3; s := 4; +--R +--R +--R Type: PositiveInteger +--E 34 + +--S 35 of 36 +lhs := reduce(+, [reduce(+, [ g(l,t)*gam(l)*gam(m)*gam(n)*gam(r)*gam(s)*gam(t) for l in 1..4]) for t in 1..4]) +--R +--R +--R (6) - 4e e e e +--R 1 2 3 4 +--R Type: CliffordAlgebra(4,Fraction Integer,MATRIX) +--E 35 + +--S 36 of 36 +rhs := 2*(gam s * gam m*gam n*gam r + gam r*gam n*gam m*gam s) +--R +--R +--R (7) - 4e e e e +--R 1 2 3 4 +--R Type: CliffordAlgebra(4,Fraction Integer,MATRIX) +--E 36 +)spool +)lisp (bye) +@ +<>= +==================================================================== +CliffordAlgebra examples +==================================================================== + +CliffordAlgebra(n,K,Q) defines a vector space of dimension 2^n over +the field K with a given quadratic form Q. If {e1..en} is a basis for +K^n then + + +{ 1, + e(i) 1 <= i <= n, + e(i1)*e(i2) 1 <= i1 < i2 <=n, + ..., + e(1)*e(2)*...*e(n) } + +is a basis for the Clifford algebra. The algebra is defined by the relations + + e(i)*e(i) = Q(e(i)) + e(i)*e(j) = -e(j)*e(i), for i ^= j + +Examples of Clifford Algebras are gaussians (complex numbers), +quaternions, exterior algebras and spin algebras. + +==================================================================== +The Complex Numbers as a Clifford Algebra +==================================================================== + +This is the field over which we will work, rational functions with +integer coefficients. + + K := Fraction Polynomial Integer + Fraction Polynomial Integer + Type: Domain + +We use this matrix for the quadratic form. + + m := matrix [ [-1] ] + [- 1] + Type: Matrix Integer + +We get complex arithmetic by using this domain. + + C := CliffordAlgebra(1, K, quadraticForm m) + CliffordAlgebra(1,Fraction Polynomial Integer,MATRIX) + Type: Domain + +Here is i, the usual square root of -1. + + i: C := e(1) + e + 1 + Type: CliffordAlgebra(1,Fraction Polynomial Integer,MATRIX) + +Here are some examples of the arithmetic. + + x := a + b * i + a + b e + 1 + Type: CliffordAlgebra(1,Fraction Polynomial Integer,MATRIX) + + y := c + d * i + c + d e + 1 + Type: CliffordAlgebra(1,Fraction Polynomial Integer,MATRIX) + + x * y + - b d + a c + (a d + b c)e + 1 + Type: CliffordAlgebra(1,Fraction Polynomial Integer,MATRIX) + +==================================================================== +The Quaternion Numbers as a Clifford Algebra +==================================================================== + +This is the field over which we will work, rational functions with +integer coefficients. + + K := Fraction Polynomial Integer + Fraction Polynomial Integer + Type: Domain + +We use this matrix for the quadratic form. + + m := matrix [ [-1,0],[0,-1] ] + +- 1 0 + + | | + + 0 - 1+ + Type: Matrix Integer + +The resulting domain is the quaternions. + + H := CliffordAlgebra(2, K, quadraticForm m) + CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) + Type: Domain + +We use Hamilton's notation for i, j, k. + + i: H := e(1) + e + 1 + Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) + + j: H := e(2) + e + 2 + Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) + + k: H := i * j + e e + 1 2 + Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) + + x := a + b * i + c * j + d * k + a + b e + c e + d e e + 1 2 1 2 + Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) + + y := e + f * i + g * j + h * k + e + f e + g e + h e e + 1 2 1 2 + Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) + + x + y + e + a + (f + b)e + (g + c)e + (h + d)e e + 1 2 1 2 + Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) + + x * y + - d h - c g - b f + a e + (c h - d g + a f + b e)e + 1 + + + (- b h + a g + d f + c e)e + (a h + b g - c f + d e)e e + 2 1 2 + Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) + + y * x + - d h - c g - b f + a e + (- c h + d g + a f + b e)e + 1 + + + (b h + a g - d f + c e)e + (a h - b g + c f + d e)e e + 2 1 2 + Type: CliffordAlgebra(2,Fraction Polynomial Integer,MATRIX) + +==================================================================== +The Exterior Algebra on a Three Space +==================================================================== + +This is the field over which we will work, rational functions with +integer coefficients. + + K := Fraction Polynomial Integer + Fraction Polynomial Integer + Type: Domain + +If we chose the three by three zero quadratic form, we obtain +the exterior algebra on e(1),e(2),e(3). + + Ext := CliffordAlgebra(3, K, quadraticForm 0) + CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) + Type: Domain + +This is a three dimensional vector algebra. We define i, j, k as the +unit vectors. + + i: Ext := e(1) + e + 1 + Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) + + j: Ext := e(2) + e + 2 + Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) + + k: Ext := e(3) + e + 3 + Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) + +Now it is possible to do arithmetic. + + x := x1*i + x2*j + x3*k + x1 e + x2 e + x3 e + 1 2 3 + Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) + + y := y1*i + y2*j + y3*k + y1 e + y2 e + y3 e + 1 2 3 + Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) + + x + y + (y1 + x1)e + (y2 + x2)e + (y3 + x3)e + 1 2 3 + Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) + + x * y + y * x + 0 + Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) + +On an n space, a grade p form has a dual n-p form. In particular, in +three space the dual of a grade two element identifies + + e1*e2 -> e3, e2*e3 -> e1, e3*e1 -> e2. + + dual2 a == coefficient(a,[2,3]) * i + coefficient(a,[3,1]) * j + coefficient(a,[1,2]) * k + Type: Void + +The vector cross product is then given by this. + + dual2(x*y) + (x2 y3 - x3 y2)e + (- x1 y3 + x3 y1)e + (x1 y2 - x2 y1)e + 1 2 3 + Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX) + +==================================================================== +The Dirac Spin Algebra +==================================================================== + +In this section we will work over the field of rational numbers. + + K := Fraction Integer + Fraction Integer + Type: Domain + +We define the quadratic form to be the Minkowski space-time metric. + + g := matrix [ [1,0,0,0], [0,-1,0,0], [0,0,-1,0], [0,0,0,-1] ] + +1 0 0 0 + + | | + |0 - 1 0 0 | + | | + |0 0 - 1 0 | + | | + +0 0 0 - 1+ + Type: Matrix Integer + +We obtain the Dirac spin algebra used in Relativistic Quantum Field Theory. + + D := CliffordAlgebra(4,K, quadraticForm g) + CliffordAlgebra(4,Fraction Integer,MATRIX) + Type: Domain + +The usual notation for the basis is gamma with a superscript. For +Axiom input we will use gam(i): + + gam := [e(i)$D for i in 1..4] + [e ,e ,e ,e ] + 1 2 3 4 + Type: List CliffordAlgebra(4,Fraction Integer,MATRIX) + +There are various contraction identities of the form + + g(l,t)*gam(l)*gam(m)*gam(n)*gam(r)*gam(s)*gam(t) = + 2*(gam(s)gam(m)gam(n)gam(r) + gam(r)*gam(n)*gam(m)*gam(s)) + +where a sum over l and t is implied. + +Verify this identity for particular values of m,n,r,s. + + m := 1; n:= 2; r := 3; s := 4; + Type: PositiveInteger + + lhs := reduce(+, [reduce(+, [ g(l,t)*gam(l)*gam(m)*gam(n)*gam(r)*gam(s)*gam(t) for l in 1..4]) for t in 1..4]) + - 4e e e e + 1 2 3 4 + Type: CliffordAlgebra(4,Fraction Integer,MATRIX) + + rhs := 2*(gam s * gam m*gam n*gam r + gam r*gam n*gam m*gam s) + - 4e e e e + 1 2 3 4 + Type: CliffordAlgebra(4,Fraction Integer,MATRIX) + +See Also: +o )help Complex +o )help Quaternion +o )show CliffordAlgebra +o $AXIOM/doc/src/algebra/clifford.spad + +@ +<>= +"CLIF" -> "RING" +"CliffordAlgebra(a:PositiveInteger,b:Field,c:QuadraticForm(a,b))" -> + "Ring()" +"CLIF" -> "ALGEBRA" +"CliffordAlgebra(a:PositiveInteger,b:Field,c:QuadraticForm(a,b))" -> + "Algebra(a:Field)" +"CLIF" -> "VSPACE" +"CliffordAlgebra(a:PositiveInteger,b:Field,c:QuadraticForm(a,b))" -> + "VectorSpace(a:Field)" +@ +\pagehead{CliffordAlgebra}{CLIF} +\pagepic{ps/v103cliffordalgebra.ps}{CLIF}{1.00} +See also:\\ +\refto{QuadraticForm}{QFORM} +<>= +)abbrev domain CLIF CliffordAlgebra +++ Author: Stephen M. Watt +++ Date Created: August 1988 +++ Date Last Updated: May 17, 1991 +++ Basic Operations: wholeRadix, fractRadix, wholeRagits, fractRagits +++ Related Domains: QuadraticForm, Quaternion, Complex +++ Also See: +++ AMS Classifications: +++ Keywords: clifford algebra, grassman algebra, spin algebra +++ Examples: +++ References: +++ +++ Description: +++ CliffordAlgebra(n, K, Q) defines a vector space of dimension \spad{2**n} +++ over K, given a quadratic form Q on \spad{K**n}. +++ +++ If \spad{e[i]}, \spad{1<=i<=n} is a basis for \spad{K**n} then +++ 1, \spad{e[i]} (\spad{1<=i<=n}), \spad{e[i1]*e[i2]} +++ (\spad{1<=i1 PositiveInteger + NNI==> NonNegativeInteger + + T ==> Join(Ring, Algebra(K), VectorSpace(K)) with + e: PI -> % + ++ e(n) produces the appropriate unit element. + monomial: (K, List PI) -> % + ++ monomial(c,[i1,i2,...,iN]) produces the value given by + ++ \spad{c*e(i1)*e(i2)*...*e(iN)}. + coefficient: (%, List PI) -> K + ++ coefficient(x,[i1,i2,...,iN]) extracts the coefficient of + ++ \spad{e(i1)*e(i2)*...*e(iN)} in x. + recip: % -> Union(%, "failed") + ++ recip(x) computes the multiplicative inverse of x or "failed" + ++ if x is not invertible. + + Impl ==> add + Qeelist := [Q unitVector(i::PositiveInteger) for i in 1..n] + dim := 2**n + + Rep := PrimitiveArray K + + New ==> new(dim, 0$K)$Rep + + x, y, z: % + c: K + m: Integer + + characteristic() == characteristic()$K + dimension() == dim::CardinalNumber + + x = y == + for i in 0..dim-1 repeat + if x.i ^= y.i then return false + true + + x + y == (z := New; for i in 0..dim-1 repeat z.i := x.i + y.i; z) + x - y == (z := New; for i in 0..dim-1 repeat z.i := x.i - y.i; z) + - x == (z := New; for i in 0..dim-1 repeat z.i := - x.i; z) + m * x == (z := New; for i in 0..dim-1 repeat z.i := m*x.i; z) + c * x == (z := New; for i in 0..dim-1 repeat z.i := c*x.i; z) + + 0 == New + 1 == (z := New; z.0 := 1; z) + coerce(m): % == (z := New; z.0 := m::K; z) + coerce(c): % == (z := New; z.0 := c; z) + + e b == + b::NNI > n => error "No such basis element" + iz := 2**((b-1)::NNI) + z := New; z.iz := 1; z + + -- The ei*ej products could instead be precomputed in + -- a (2**n)**2 multiplication table. + addMonomProd(c1: K, b1: NNI, c2: K, b2: NNI, z: %): % == + c := c1 * c2 + bz := b2 + for i in 0..n-1 | bit?(b1,i) repeat + -- Apply rule ei*ej = -ej*ei for i^=j + k := 0 + for j in i+1..n-1 | bit?(b1, j) repeat k := k+1 + for j in 0..i-1 | bit?(bz, j) repeat k := k+1 + if odd? k then c := -c + -- Apply rule ei**2 = Q(ei) + if bit?(bz,i) then + c := c * Qeelist.(i+1) + bz:= (bz - 2**i)::NNI + else + bz:= bz + 2**i + z.bz := z.bz + c + z + + x * y == + z := New + for ix in 0..dim-1 repeat + if x.ix ^= 0 then for iy in 0..dim-1 repeat + if y.iy ^= 0 then addMonomProd(x.ix,ix,y.iy,iy,z) + z + + canonMonom(c: K, lb: List PI): Record(coef: K, basel: NNI) == + -- 0. Check input + for b in lb repeat b > n => error "No such basis element" + + -- 1. Apply identity ei*ej = -ej*ei, i^=j. + -- The Rep assumes n is small so bubble sort is ok. + -- Using bubble sort keeps the exchange info obvious. + wasordered := false + exchanges := 0 + while not wasordered repeat + wasordered := true + for i in 1..#lb-1 repeat + if lb.i > lb.(i+1) then + t := lb.i; lb.i := lb.(i+1); lb.(i+1) := t + exchanges := exchanges + 1 + wasordered := false + if odd? exchanges then c := -c + + -- 2. Prepare the basis element + -- Apply identity ei*ei = Q(ei). + bz := 0 + for b in lb repeat + bn := (b-1)::NNI + if bit?(bz, bn) then + c := c * Qeelist bn + bz:= ( bz - 2**bn )::NNI + else + bz:= bz + 2**bn + [c, bz::NNI] + + monomial(c, lb) == + r := canonMonom(c, lb) + z := New + z r.basel := r.coef + z + coefficient(z, lb) == + r := canonMonom(1, lb) + r.coef = 0 => error "Cannot take coef of 0" + z r.basel/r.coef + + Ex ==> OutputForm + + coerceMonom(c: K, b: NNI): Ex == + b = 0 => c::Ex + ml := [sub("e"::Ex, i::Ex) for i in 1..n | bit?(b,i-1)] + be := reduce("*", ml) + c = 1 => be + c::Ex * be + coerce(x): Ex == + tl := [coerceMonom(x.i,i) for i in 0..dim-1 | x.i^=0] + null tl => "0"::Ex + reduce("+", tl) + + + localPowerSets(j:NNI): List(List(PI)) == + l: List List PI := list [] + j = 0 => l + Sm := localPowerSets((j-1)::NNI) + Sn: List List PI := [] + for x in Sm repeat Sn := cons(cons(j pretend PI, x),Sn) + append(Sn, Sm) + + powerSets(j:NNI):List List PI == map(reverse, localPowerSets j) + + Pn:List List PI := powerSets(n) + + recip(x: %): Union(%, "failed") == + one:% := 1 + -- tmp:c := x*yC - 1$C + rhsEqs : List K := [] + lhsEqs: List List K := [] + lhsEqi: List K + for pi in Pn repeat + rhsEqs := cons(coefficient(one, pi), rhsEqs) + + lhsEqi := [] + for pj in Pn repeat + lhsEqi := cons(coefficient(x*monomial(1,pj),pi),lhsEqi) + lhsEqs := cons(reverse(lhsEqi),lhsEqs) + ans := particularSolution(matrix(lhsEqs), + vector(rhsEqs))$LinearSystemMatrixPackage(K, Vector K, Vector K, Matrix K) + ans case "failed" => "failed" + ansP := parts(ans) + ansC:% := 0 + for pj in Pn repeat + cj:= first ansP + ansP := rest ansP + ansC := ansC + cj*monomial(1,pj) + ansC + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain COLOR Color} <>= "COLOR" -> "ABELSG" @@ -8735,6 +9140,376 @@ Commutator: Export == Implement where @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain COMPLEX Complex} +<>= +-- gaussian.spad.pamphlet Complex.input +)spool Complex.output +)set message test on +)set message auto off +)clear all +--S 1 of 16 +a := complex(4/3,5/2) +--R +--R +--R 4 5 +--R (1) - + - %i +--R 3 2 +--R Type: Complex Fraction Integer +--E 1 + +--S 2 of 16 +b := complex(4/3,-5/2) +--R +--R +--R 4 5 +--R (2) - - - %i +--R 3 2 +--R Type: Complex Fraction Integer +--E 2 + +--S 3 of 16 +a + b +--R +--R +--R 8 +--R (3) - +--R 3 +--R Type: Complex Fraction Integer +--E 3 + +--S 4 of 16 +a - b +--R +--R +--R (4) 5%i +--R Type: Complex Fraction Integer +--E 4 + +--S 5 of 16 +a * b +--R +--R +--R 289 +--R (5) --- +--R 36 +--R Type: Complex Fraction Integer +--E 5 + +--S 6 of 16 +a / b +--R +--R +--R 161 240 +--R (6) - --- + --- %i +--R 289 289 +--R Type: Complex Fraction Integer +--E 6 + +--S 7 of 16 +% :: Fraction Complex Integer +--R +--R +--R - 15 + 8%i +--R (7) ---------- +--R 15 + 8%i +--R Type: Fraction Complex Integer +--E 7 + +--S 8 of 16 +3.4 + 6.7 * %i +--R +--R +--R (8) 3.4 + 6.7 %i +--R Type: Complex Float +--E 8 + +--S 9 of 16 +conjugate a +--R +--R +--R 4 5 +--R (9) - - - %i +--R 3 2 +--R Type: Complex Fraction Integer +--E 9 + +--S 10 of 16 +norm a +--R +--R +--R 289 +--R (10) --- +--R 36 +--R Type: Fraction Integer +--E 10 + +--S 11 of 16 +real a +--R +--R +--R 4 +--R (11) - +--R 3 +--R Type: Fraction Integer +--E 11 + +--S 12 of 16 +imag a +--R +--R +--R 5 +--R (12) - +--R 2 +--R Type: Fraction Integer +--E 12 + +--S 13 of 16 +gcd(13 - 13*%i,31 + 27*%i) +--R +--R +--R (13) 5 + %i +--R Type: Complex Integer +--E 13 + +--S 14 of 16 +lcm(13 - 13*%i,31 + 27*%i) +--R +--R +--R (14) 143 - 39%i +--R Type: Complex Integer +--E 14 + +--S 15 of 16 +factor(13 - 13*%i) +--R +--R +--R (15) - (1 + %i)(2 + 3%i)(3 + 2%i) +--R Type: Factored Complex Integer +--E 15 + +--S 16 of 16 +factor complex(2,0) +--R +--R +--R 2 +--R (16) - %i (1 + %i) +--R Type: Factored Complex Integer +--E 16 +)spool +)lisp (bye) +@ +<>= +==================================================================== +Complex examples +==================================================================== + +The Complex constructor implements complex objects over a commutative +ring R. Typically, the ring R is Integer, Fraction Integer, Float or +DoubleFloat. R can also be a symbolic type, like Polynomial Integer. + +Complex objects are created by the complex operation. + + a := complex(4/3,5/2) + 4 5 + - + - %i + 3 2 + Type: Complex Fraction Integer + + b := complex(4/3,-5/2) + 4 5 + - - - %i + 3 2 + Type: Complex Fraction Integer + +The standard arithmetic operations are available. + + a + b + 8 + - + 3 + Type: Complex Fraction Integer + + a - b + 5%i + Type: Complex Fraction Integer + + a * b + 289 + --- + 36 + Type: Complex Fraction Integer + +If R is a field, you can also divide the complex objects. + + a / b + 161 240 + - --- + --- %i + 289 289 + Type: Complex Fraction Integer + + +We can view the last object as a fraction of complex integers. + + % :: Fraction Complex Integer + - 15 + 8%i + ---------- + 15 + 8%i + Type: Fraction Complex Integer + +The predefined macro %i is defined to be complex(0,1). + + 3.4 + 6.7 * %i + 3.4 + 6.7 %i + Type: Complex Float + +You can also compute the conjugate and norm of a complex number. + + conjugate a + 4 5 + - - - %i + 3 2 + Type: Complex Fraction Integer + + norm a + 289 + --- + 36 + Type: Fraction Integer + +The real and imag operations are provided to extract the real and +imaginary parts, respectively. + + real a + 4 + - + 3 + Type: Fraction Integer + + imag a + 5 + - + 2 + Type: Fraction Integer + +The domain Complex Integer is also called the Gaussian integers. If R +is the integers (or, more generally, a EuclideanDomain), you can compute +greatest common divisors. + + gcd(13 - 13*%i,31 + 27*%i) + 5 + %i + Type: Complex Integer + +You can also compute least common multiples. + + lcm(13 - 13*%i,31 + 27*%i) + 143 - 39%i + Type: Complex Integer + +You can factor Gaussian integers. + + factor(13 - 13*%i) + - (1 + %i)(2 + 3%i)(3 + 2%i) + Type: Factored Complex Integer + + factor complex(2,0) + 2 + - %i (1 + %i) + Type: Factored Complex Integer + +See Also +o )show Complex +o $AXIOM/doc/src/algebra/gaussian.spad.dvi + +@ +\pagehead{Complex}{COMPLEX} +\pagepic{ps/v103complex.ps}{COMPLEX}{1.00} +<>= +)abbrev domain COMPLEX Complex +++ Author: +++ Date Created: +++ Date Last Updated: +++ Basic Functions: +++ Related Constructors: +++ Also See: +++ AMS Classifications: +++ Keywords: +++ References: +++ Description: +++ \spadtype {Complex(R)} creates the domain of elements of the form +++ \spad{a + b * i} where \spad{a} and b come from the ring R, +++ and i is a new element such that \spad{i**2 = -1}. +Complex(R:CommutativeRing): ComplexCategory(R) with + if R has OpenMath then OpenMath + == add + Rep := Record(real:R, imag:R) + + if R has OpenMath then + writeOMComplex(dev: OpenMathDevice, x: %): Void == + OMputApp(dev) + OMputSymbol(dev, "complex1", "complex__cartesian") + OMwrite(dev, real x) + OMwrite(dev, imag x) + OMputEndApp(dev) + + OMwrite(x: %): String == + s: String := "" + sp := OM_-STRINGTOSTRINGPTR(s)$Lisp + dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML) + OMputObject(dev) + writeOMComplex(dev, x) + OMputEndObject(dev) + OMclose(dev) + s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String + s + + OMwrite(x: %, wholeObj: Boolean): String == + s: String := "" + sp := OM_-STRINGTOSTRINGPTR(s)$Lisp + dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML) + if wholeObj then + OMputObject(dev) + writeOMComplex(dev, x) + if wholeObj then + OMputEndObject(dev) + OMclose(dev) + s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String + s + + OMwrite(dev: OpenMathDevice, x: %): Void == + OMputObject(dev) + writeOMComplex(dev, x) + OMputEndObject(dev) + + OMwrite(dev: OpenMathDevice, x: %, wholeObj: Boolean): Void == + if wholeObj then + OMputObject(dev) + writeOMComplex(dev, x) + if wholeObj then + OMputEndObject(dev) + + 0 == [0, 0] + 1 == [1, 0] + zero? x == zero?(x.real) and zero?(x.imag) +-- one? x == one?(x.real) and zero?(x.imag) + one? x == ((x.real) = 1) and zero?(x.imag) + coerce(r:R):% == [r, 0] + complex(r, i) == [r, i] + real x == x.real + imag x == x.imag + x + y == [x.real + y.real, x.imag + y.imag] + -- by re-defining this here, we save 5 fn calls + x:% * y:% == + [x.real * y.real - x.imag * y.imag, + x.imag * y.real + y.imag * x.real] -- here we save nine! + + + if R has IntegralDomain then + _exquo(x:%, y:%) == -- to correct bad defaulting problem + zero? y.imag => x exquo y.real + x * conjugate(y) exquo norm(y) + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain CONTFRAC ContinuedFraction} <>= -- contfrac.spad.pamphlet ContinuedFraction.input @@ -12224,6 +12999,257 @@ DifferentialSparseMultivariatePolynomial(R, S, V): @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain DMP DistributedMultivariatePolynomial} +<>= +-- gdpoly.spad.pamphlet DistributedMultivariatePolynomial.input +)spool DistributedMultivariatePolynomial.output +)set message test on +)set message auto off +)clear all +--S 1 of 10 +(d1,d2,d3) : DMP([z,y,x],FRAC INT) +--R +--R Type: Void +--E 1 + +--S 2 of 10 +d1 := -4*z + 4*y**2*x + 16*x**2 + 1 +--R +--R +--R 2 2 +--R (2) - 4z + 4y x + 16x + 1 +--R Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 2 + +--S 3 of 10 +d2 := 2*z*y**2 + 4*x + 1 +--R +--R +--R 2 +--R (3) 2z y + 4x + 1 +--R Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 3 + +--S 4 of 10 +d3 := 2*z*x**2 - 2*y**2 - x +--R +--R +--R 2 2 +--R (4) 2z x - 2y - x +--R Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 4 + +--S 5 of 10 +groebner [d1,d2,d3] +--R +--R +--R (5) +--R 1568 6 1264 5 6 4 182 3 2047 2 103 2857 +--R [z - ---- x - ---- x + --- x + --- x - ---- x - ---- x - -----, +--R 2745 305 305 549 610 2745 10980 +--R 2 112 6 84 5 1264 4 13 3 84 2 1772 2 +--R y + ---- x - --- x - ---- x - --- x + --- x + ---- x + ----, +--R 2745 305 305 549 305 2745 2745 +--R 7 29 6 17 4 11 3 1 2 15 1 +--R x + -- x - -- x - -- x + -- x + -- x + -] +--R 4 16 8 32 16 4 +--R Type: List DistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 5 + +--S 6 of 10 +(n1,n2,n3) : HDMP([z,y,x],FRAC INT) +--R +--R Type: Void +--E 6 + +--S 7 of 10 +n1 := d1 +--R +--R +--R 2 2 +--R (7) 4y x + 16x - 4z + 1 +--R Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 7 + +--S 8 of 10 +n2 := d2 +--R +--R +--R 2 +--R (8) 2z y + 4x + 1 +--R Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 8 + +--S 9 of 10 +n3 := d3 +--R +--R +--R 2 2 +--R (9) 2z x - 2y - x +--R Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 9 + +--S 10 of 10 +groebner [n1,n2,n3] +--R +--R +--R (10) +--R 4 3 3 2 1 1 4 29 3 1 2 7 9 1 +--R [y + 2x - - x + - z - -, x + -- x - - y - - z x - -- x - -, +--R 2 2 8 4 8 4 16 4 +--R 2 1 2 2 1 2 2 1 +--R z y + 2x + -, y x + 4x - z + -, z x - y - - x, +--R 2 4 2 +--R 2 2 2 1 3 +--R z - 4y + 2x - - z - - x] +--R 4 2 +--RType: List HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 10 +)spool +)lisp (bye) +@ + +<>= +==================================================================== +MultivariatePolynomial +DistributedMultivariatePolynomial +HomogeneousDistributedMultivariatePolynomial +GeneralDistributedMultivariatePolynomial +==================================================================== + +DistributedMultivariatePolynomial which is abbreviated as DMP and +HomogeneousDistributedMultivariatePolynomial, which is abbreviated +as HDMP, are very similar to MultivariatePolynomial except that +they are represented and displayed in a non-recursive manner. + + (d1,d2,d3) : DMP([z,y,x],FRAC INT) + Type: Void + +The constructor DMP orders its monomials lexicographically while +HDMP orders them by total order refined by reverse lexicographic +order. + + d1 := -4*z + 4*y**2*x + 16*x**2 + 1 + 2 2 + - 4z + 4y x + 16x + 1 + Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) + + d2 := 2*z*y**2 + 4*x + 1 + 2 + 2z y + 4x + 1 + Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) + + d3 := 2*z*x**2 - 2*y**2 - x + 2 2 + 2z x - 2y - x + Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) + +These constructors are mostly used in Groebner basis calculations. + + groebner [d1,d2,d3] + 1568 6 1264 5 6 4 182 3 2047 2 103 2857 + [z - ---- x - ---- x + --- x + --- x - ---- x - ---- x - -----, + 2745 305 305 549 610 2745 10980 + 2 112 6 84 5 1264 4 13 3 84 2 1772 2 + y + ---- x - --- x - ---- x - --- x + --- x + ---- x + ----, + 2745 305 305 549 305 2745 2745 + 7 29 6 17 4 11 3 1 2 15 1 + x + -- x - -- x - -- x + -- x + -- x + -] + 4 16 8 32 16 4 + Type: List DistributedMultivariatePolynomial([z,y,x],Fraction Integer) + + (n1,n2,n3) : HDMP([z,y,x],FRAC INT) + Type: Void + + n1 := d1 + 2 2 + 4y x + 16x - 4z + 1 + Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) + + n2 := d2 + 2 + 2z y + 4x + 1 + Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) + + n3 := d3 + 2 2 + 2z x - 2y - x + Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) + +Note that we get a different Groebner basis when we use the HDMP +polynomials, as expected. + + groebner [n1,n2,n3] + 4 3 3 2 1 1 4 29 3 1 2 7 9 1 + [y + 2x - - x + - z - -, x + -- x - - y - - z x - -- x - -, + 2 2 8 4 8 4 16 4 + 2 1 2 2 1 2 2 1 + z y + 2x + -, y x + 4x - z + -, z x - y - - x, + 2 4 2 + 2 2 2 1 3 + z - 4y + 2x - - z - - x] + 4 2 + Type: List HomogeneousDistributedMultivariatePolynomial([z,y,x], + Fraction Integer) + +GeneralDistributedMultivariatePolynomial is somewhat more flexible in +the sense that as well as accepting a list of variables to specify the +variable ordering, it also takes a predicate on exponent vectors to +specify the term ordering. With this polynomial type the user can +experiment with the effect of using completely arbitrary term orderings. +This flexibility is mostly important for algorithms such as Groebner +basis calculations which can be very sensitive to term ordering. + +See Also: +o )help Polynomial +o )help UnivariatePolynomial +o )help MultivariatePolynomial +o )help HomogeneousDistributedMultivariatePolynomial +o )help GeneralDistributedMultivariatePolynomial +o )show DistributedMultivariatePolynomial +o $AXIOM/doc/src/algebra/gdpoly.spad.dvi + +@ +\pagehead{DistributedMultivariatePolynomial}{DMP} +\pagepic{ps/v103distributedmultivariatepolynomial.ps}{DMP}{1.00} +See also:\\ +\refto{GeneralDistributedMultivariatePolynomial}{GDMP} +\refto{HomogeneousDistributedMultivariatePolynomial}{HDMP} +<>= +)abbrev domain DMP DistributedMultivariatePolynomial +++ Author: Barry Trager +++ Date Created: +++ Date Last Updated: +++ Basic Functions: Ring, degree, eval, coefficient, monomial, differentiate, +++ resultant, gcd, leadingCoefficient +++ Related Constructors: GeneralDistributedMultivariatePolynomial, +++ HomogeneousDistributedMultivariatePolynomial +++ Also See: Polynomial +++ AMS Classifications: +++ Keywords: polynomial, multivariate, distributed +++ References: +++ Description: +++ This type supports distributed multivariate polynomials +++ whose variables are from a user specified list of symbols. +++ The coefficient ring may be non commutative, +++ but the variables are assumed to commute. +++ The term ordering is lexicographic specified by the variable +++ list parameter with the most significant variable first in the list. +DistributedMultivariatePolynomial(vl,R): public == private where + vl : List Symbol + R : Ring + E ==> DirectProduct(#vl,NonNegativeInteger) + OV ==> OrderedVariableList(vl) + public == PolynomialCategory(R,E,OV) with + reorder: (%,List Integer) -> % + ++ reorder(p, perm) applies the permutation perm to the variables + ++ in a polynomial and returns the new correctly ordered polynomial + + private == + GeneralDistributedMultivariatePolynomial(vl,R,E) + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain DROPT DrawOption} \pagehead{DrawOption}{DROPT} \pagepic{ps/v103drawoption.ps}{DROPT}{1.00} @@ -13610,9 +14636,9 @@ d02cjfAnnaType():OrdinaryDifferentialEquationsSolverCategory == Result add @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain D02EJFA d02ejfAnnaType} -<>= \pagehead{d02ejfAnnaType}{D02EJFA} \pagepic{ps/v103d02ejfannatype.ps}{D02EJFA}{1.00} +<>= )abbrev domain D02EJFA d02ejfAnnaType ++ Author: Brian Dupee ++ Date Created: February 1995 @@ -13838,6 +14864,413 @@ d03fafAnnaType():PartialDifferentialEquationsSolverCategory == Result add %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Chapter E} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain EQ Equation} +<>= +-- equation2.spad.pamphlet Equation.input +)spool Equation.output +)set message test on +)set message auto off +)clear all +--S 1 +eq1 := 3*x + 4*y = 5 +--R +--R +--R (1) 4y + 3x= 5 +--R Type: Equation Polynomial Integer +--E 1 + +--S 2 +eq2 := 2*x + 2*y = 3 +--R +--R +--R (2) 2y + 2x= 3 +--R Type: Equation Polynomial Integer +--E 2 + +--S 3 +lhs eq1 +--R +--R +--R (3) 4y + 3x +--R Type: Polynomial Integer +--E 3 + +--S 4 +rhs eq1 +--R +--R +--R (4) 5 +--R Type: Polynomial Integer +--E 4 + +--S 5 +eq1 + eq2 +--R +--R +--R (5) 6y + 5x= 8 +--R Type: Equation Polynomial Integer +--E 5 + +--S 6 +eq1 * eq2 +--R +--R +--R 2 2 +--R (6) 8y + 14x y + 6x = 15 +--R Type: Equation Polynomial Integer +--E 6 + +--S 7 +2*eq2 - eq1 +--R +--R +--R (7) x= 1 +--R Type: Equation Polynomial Integer +--E 7 + +--S 8 +eq1**2 +--R +--R +--R 2 2 +--R (8) 16y + 24x y + 9x = 25 +--R Type: Equation Polynomial Integer +--E 8 + +--S 9 +if x+1 = y then "equal" else "unequal" +--R +--R +--R (9) "unequal" +--R Type: String +--E 9 + +--S 10 +eqpol := x+1 = y +--R +--R +--R (10) x + 1= y +--R Type: Equation Polynomial Integer +--E 10 + +--S 11 +if eqpol then "equal" else "unequal" +--R +--R +--R (11) "unequal" +--R Type: String +--E 11 + +--S 12 +eqpol::Boolean +--R +--R +--R (12) false +--R Type: Boolean +--E 12 +)spool +)lisp (bye) +@ +<>= +==================================================================== +Equation examples +==================================================================== + +The Equation domain provides equations as mathematical objects. These +are used, for example, as the input to various solve operations. + +Equations are created using the equals symbol, =. + + eq1 := 3*x + 4*y = 5 + 4y + 3x= 5 + Type: Equation Polynomial Integer + + eq2 := 2*x + 2*y = 3 + 2y + 2x= 3 + Type: Equation Polynomial Integer + +The left- and right-hand sides of an equation are accessible using +the operations lhs and rhs. + + lhs eq1 + 4y + 3x + Type: Polynomial Integer + + rhs eq1 + 5 + Type: Polynomial Integer + +Arithmetic operations are supported and operate on both sides of the +equation. + + eq1 + eq2 + 6y + 5x= 8 + Type: Equation Polynomial Integer + + eq1 * eq2 + 2 2 + 8y + 14x y + 6x = 15 + Type: Equation Polynomial Integer + + 2*eq2 - eq1 + x= 1 + Type: Equation Polynomial Integer + +Equations may be created for any type so the arithmetic operations +will be defined only when they make sense. For example, exponentiation +is not defined for equations involving non-square matrices. + + eq1**2 + 2 2 + 16y + 24x y + 9x = 25 + Type: Equation Polynomial Integer + +Note that an equals symbol is also used to test for equality of values +in certain contexts. For example, x+1 and y are unequal as polynomials. + + if x+1 = y then "equal" else "unequal" + "unequal" + Type: String + + eqpol := x+1 = y + x + 1= y + Type: Equation Polynomial Integer + +If an equation is used where a Boolean value is required, then +it is evaluated using the equality test from the operand type. + + if eqpol then "equal" else "unequal" + "unequal" + Type: String + +If one wants a Boolean value rather than an equation, all one has to +do is ask! + + eqpol::Boolean + false + Type: Boolean + +See Also: +o )show Equation +o $AXIOM/doc/src/algebra/equation2.spad.dvi + +@ +\pagehead{Equation}{EQ} +\pagepic{ps/v103equation.ps}{EQ}{1.00} +<>= +)abbrev domain EQ Equation +--FOR THE BENEFIT OF LIBAX0 GENERATION +++ Author: Stephen M. Watt, enhancements by Johannes Grabmeier +++ Date Created: April 1985 +++ Date Last Updated: June 3, 1991; September 2, 1992 +++ Basic Operations: = +++ Related Domains: +++ Also See: +++ AMS Classifications: +++ Keywords: equation +++ Examples: +++ References: +++ Description: +++ Equations as mathematical objects. All properties of the basis domain, +++ e.g. being an abelian group are carried over the equation domain, by +++ performing the structural operations on the left and on the +++ right hand side. +-- The interpreter translates "=" to "equation". Otherwise, it will +-- find a modemap for "=" in the domain of the arguments. + +Equation(S: Type): public == private where + Ex ==> OutputForm + public ==> Type with + "=": (S, S) -> $ + ++ a=b creates an equation. + equation: (S, S) -> $ + ++ equation(a,b) creates an equation. + swap: $ -> $ + ++ swap(eq) interchanges left and right hand side of equation eq. + lhs: $ -> S + ++ lhs(eqn) returns the left hand side of equation eqn. + rhs: $ -> S + ++ rhs(eqn) returns the right hand side of equation eqn. + map: (S -> S, $) -> $ + ++ map(f,eqn) constructs a new equation by applying f to both + ++ sides of eqn. + if S has InnerEvalable(Symbol,S) then + InnerEvalable(Symbol,S) + if S has SetCategory then + SetCategory + CoercibleTo Boolean + if S has Evalable(S) then + eval: ($, $) -> $ + ++ eval(eqn, x=f) replaces x by f in equation eqn. + eval: ($, List $) -> $ + ++ eval(eqn, [x1=v1, ... xn=vn]) replaces xi by vi in equation eqn. + if S has AbelianSemiGroup then + AbelianSemiGroup + "+": (S, $) -> $ + ++ x+eqn produces a new equation by adding x to both sides of + ++ equation eqn. + "+": ($, S) -> $ + ++ eqn+x produces a new equation by adding x to both sides of + ++ equation eqn. + if S has AbelianGroup then + AbelianGroup + leftZero : $ -> $ + ++ leftZero(eq) subtracts the left hand side. + rightZero : $ -> $ + ++ rightZero(eq) subtracts the right hand side. + "-": (S, $) -> $ + ++ x-eqn produces a new equation by subtracting both sides of + ++ equation eqn from x. + "-": ($, S) -> $ + ++ eqn-x produces a new equation by subtracting x from both sides of + ++ equation eqn. + if S has SemiGroup then + SemiGroup + "*": (S, $) -> $ + ++ x*eqn produces a new equation by multiplying both sides of + ++ equation eqn by x. + "*": ($, S) -> $ + ++ eqn*x produces a new equation by multiplying both sides of + ++ equation eqn by x. + if S has Monoid then + Monoid + leftOne : $ -> Union($,"failed") + ++ leftOne(eq) divides by the left hand side, if possible. + rightOne : $ -> Union($,"failed") + ++ rightOne(eq) divides by the right hand side, if possible. + if S has Group then + Group + leftOne : $ -> Union($,"failed") + ++ leftOne(eq) divides by the left hand side. + rightOne : $ -> Union($,"failed") + ++ rightOne(eq) divides by the right hand side. + if S has Ring then + Ring + BiModule(S,S) + if S has CommutativeRing then + Module(S) + --Algebra(S) + if S has IntegralDomain then + factorAndSplit : $ -> List $ + ++ factorAndSplit(eq) make the right hand side 0 and + ++ factors the new left hand side. Each factor is equated + ++ to 0 and put into the resulting list without repetitions. + if S has PartialDifferentialRing(Symbol) then + PartialDifferentialRing(Symbol) + if S has Field then + VectorSpace(S) + "/": ($, $) -> $ + ++ e1/e2 produces a new equation by dividing the left and right + ++ hand sides of equations e1 and e2. + inv: $ -> $ + ++ inv(x) returns the multiplicative inverse of x. + if S has ExpressionSpace then + subst: ($, $) -> $ + ++ subst(eq1,eq2) substitutes eq2 into both sides of eq1 + ++ the lhs of eq2 should be a kernel + + private ==> add + Rep := Record(lhs: S, rhs: S) + eq1,eq2: $ + s : S + if S has IntegralDomain then + factorAndSplit eq == + (S has factor : S -> Factored S) => + eq0 := rightZero eq + [equation(rcf.factor,0) for rcf in factors factor lhs eq0] + [eq] + l:S = r:S == [l, r] + equation(l, r) == [l, r] -- hack! See comment above. + lhs eqn == eqn.lhs + rhs eqn == eqn.rhs + swap eqn == [rhs eqn, lhs eqn] + map(fn, eqn) == equation(fn(eqn.lhs), fn(eqn.rhs)) + + if S has InnerEvalable(Symbol,S) then + s:Symbol + ls:List Symbol + x:S + lx:List S + eval(eqn,s,x) == eval(eqn.lhs,s,x) = eval(eqn.rhs,s,x) + eval(eqn,ls,lx) == eval(eqn.lhs,ls,lx) = eval(eqn.rhs,ls,lx) + if S has Evalable(S) then + eval(eqn1:$, eqn2:$):$ == + eval(eqn1.lhs, eqn2 pretend Equation S) = + eval(eqn1.rhs, eqn2 pretend Equation S) + eval(eqn1:$, leqn2:List $):$ == + eval(eqn1.lhs, leqn2 pretend List Equation S) = + eval(eqn1.rhs, leqn2 pretend List Equation S) + if S has SetCategory then + eq1 = eq2 == (eq1.lhs = eq2.lhs)@Boolean and + (eq1.rhs = eq2.rhs)@Boolean + coerce(eqn:$):Ex == eqn.lhs::Ex = eqn.rhs::Ex + coerce(eqn:$):Boolean == eqn.lhs = eqn.rhs + if S has AbelianSemiGroup then + eq1 + eq2 == eq1.lhs + eq2.lhs = eq1.rhs + eq2.rhs + s + eq2 == [s,s] + eq2 + eq1 + s == eq1 + [s,s] + if S has AbelianGroup then + - eq == (- lhs eq) = (-rhs eq) + s - eq2 == [s,s] - eq2 + eq1 - s == eq1 - [s,s] + leftZero eq == 0 = rhs eq - lhs eq + rightZero eq == lhs eq - rhs eq = 0 + 0 == equation(0$S,0$S) + eq1 - eq2 == eq1.lhs - eq2.lhs = eq1.rhs - eq2.rhs + if S has SemiGroup then + eq1:$ * eq2:$ == eq1.lhs * eq2.lhs = eq1.rhs * eq2.rhs + l:S * eqn:$ == l * eqn.lhs = l * eqn.rhs + l:S * eqn:$ == l * eqn.lhs = l * eqn.rhs + eqn:$ * l:S == eqn.lhs * l = eqn.rhs * l + -- We have to be a bit careful here: raising to a +ve integer is OK + -- (since it's the equivalent of repeated multiplication) + -- but other powers may cause contradictions + -- Watch what else you add here! JHD 2/Aug 1990 + if S has Monoid then + 1 == equation(1$S,1$S) + recip eq == + (lh := recip lhs eq) case "failed" => "failed" + (rh := recip rhs eq) case "failed" => "failed" + [lh :: S, rh :: S] + leftOne eq == + (re := recip lhs eq) case "failed" => "failed" + 1 = rhs eq * re + rightOne eq == + (re := recip rhs eq) case "failed" => "failed" + lhs eq * re = 1 + if S has Group then + inv eq == [inv lhs eq, inv rhs eq] + leftOne eq == 1 = rhs eq * inv rhs eq + rightOne eq == lhs eq * inv rhs eq = 1 + if S has Ring then + characteristic() == characteristic()$S + i:Integer * eq:$ == (i::S) * eq + if S has IntegralDomain then + factorAndSplit eq == + (S has factor : S -> Factored S) => + eq0 := rightZero eq + [equation(rcf.factor,0) for rcf in factors factor lhs eq0] + (S has Polynomial Integer) => + eq0 := rightZero eq + MF ==> MultivariateFactorize(Symbol, IndexedExponents Symbol, _ + Integer, Polynomial Integer) + p : Polynomial Integer := (lhs eq0) pretend Polynomial Integer + [equation((rcf.factor) pretend S,0) for rcf in factors factor(p)$MF] + [eq] + if S has PartialDifferentialRing(Symbol) then + differentiate(eq:$, sym:Symbol):$ == + [differentiate(lhs eq, sym), differentiate(rhs eq, sym)] + if S has Field then + dimension() == 2 :: CardinalNumber + eq1:$ / eq2:$ == eq1.lhs / eq2.lhs = eq1.rhs / eq2.rhs + inv eq == [inv lhs eq, inv rhs eq] + if S has ExpressionSpace then + subst(eq1,eq2) == + eq3 := eq2 pretend Equation S + [subst(lhs eq1,eq3),subst(rhs eq1,eq3)] + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain EXPEXPAN ExponentialExpansion} \pagehead{ExponentialExpansion}{EXPEXPAN} \pagepic{ps/v103exponentialexpansion.ps}{EXPEXPAN}{1.00} @@ -15058,413 +16491,6 @@ ExtAlgBasis(): Export == Implement where @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{domain EQ Equation} -<>= --- equation2.spad.pamphlet Equation.input -)spool Equation.output -)set message test on -)set message auto off -)clear all ---S 1 -eq1 := 3*x + 4*y = 5 ---R ---R ---R (1) 4y + 3x= 5 ---R Type: Equation Polynomial Integer ---E 1 - ---S 2 -eq2 := 2*x + 2*y = 3 ---R ---R ---R (2) 2y + 2x= 3 ---R Type: Equation Polynomial Integer ---E 2 - ---S 3 -lhs eq1 ---R ---R ---R (3) 4y + 3x ---R Type: Polynomial Integer ---E 3 - ---S 4 -rhs eq1 ---R ---R ---R (4) 5 ---R Type: Polynomial Integer ---E 4 - ---S 5 -eq1 + eq2 ---R ---R ---R (5) 6y + 5x= 8 ---R Type: Equation Polynomial Integer ---E 5 - ---S 6 -eq1 * eq2 ---R ---R ---R 2 2 ---R (6) 8y + 14x y + 6x = 15 ---R Type: Equation Polynomial Integer ---E 6 - ---S 7 -2*eq2 - eq1 ---R ---R ---R (7) x= 1 ---R Type: Equation Polynomial Integer ---E 7 - ---S 8 -eq1**2 ---R ---R ---R 2 2 ---R (8) 16y + 24x y + 9x = 25 ---R Type: Equation Polynomial Integer ---E 8 - ---S 9 -if x+1 = y then "equal" else "unequal" ---R ---R ---R (9) "unequal" ---R Type: String ---E 9 - ---S 10 -eqpol := x+1 = y ---R ---R ---R (10) x + 1= y ---R Type: Equation Polynomial Integer ---E 10 - ---S 11 -if eqpol then "equal" else "unequal" ---R ---R ---R (11) "unequal" ---R Type: String ---E 11 - ---S 12 -eqpol::Boolean ---R ---R ---R (12) false ---R Type: Boolean ---E 12 -)spool -)lisp (bye) -@ -<>= -==================================================================== -Equation examples -==================================================================== - -The Equation domain provides equations as mathematical objects. These -are used, for example, as the input to various solve operations. - -Equations are created using the equals symbol, =. - - eq1 := 3*x + 4*y = 5 - 4y + 3x= 5 - Type: Equation Polynomial Integer - - eq2 := 2*x + 2*y = 3 - 2y + 2x= 3 - Type: Equation Polynomial Integer - -The left- and right-hand sides of an equation are accessible using -the operations lhs and rhs. - - lhs eq1 - 4y + 3x - Type: Polynomial Integer - - rhs eq1 - 5 - Type: Polynomial Integer - -Arithmetic operations are supported and operate on both sides of the -equation. - - eq1 + eq2 - 6y + 5x= 8 - Type: Equation Polynomial Integer - - eq1 * eq2 - 2 2 - 8y + 14x y + 6x = 15 - Type: Equation Polynomial Integer - - 2*eq2 - eq1 - x= 1 - Type: Equation Polynomial Integer - -Equations may be created for any type so the arithmetic operations -will be defined only when they make sense. For example, exponentiation -is not defined for equations involving non-square matrices. - - eq1**2 - 2 2 - 16y + 24x y + 9x = 25 - Type: Equation Polynomial Integer - -Note that an equals symbol is also used to test for equality of values -in certain contexts. For example, x+1 and y are unequal as polynomials. - - if x+1 = y then "equal" else "unequal" - "unequal" - Type: String - - eqpol := x+1 = y - x + 1= y - Type: Equation Polynomial Integer - -If an equation is used where a Boolean value is required, then -it is evaluated using the equality test from the operand type. - - if eqpol then "equal" else "unequal" - "unequal" - Type: String - -If one wants a Boolean value rather than an equation, all one has to -do is ask! - - eqpol::Boolean - false - Type: Boolean - -See Also: -o )show Equation -o $AXIOM/doc/src/algebra/equation2.spad.dvi - -@ -\pagehead{Equation}{EQ} -\pagepic{ps/v103equation.ps}{EQ}{1.00} -<>= -)abbrev domain EQ Equation ---FOR THE BENEFIT OF LIBAX0 GENERATION -++ Author: Stephen M. Watt, enhancements by Johannes Grabmeier -++ Date Created: April 1985 -++ Date Last Updated: June 3, 1991; September 2, 1992 -++ Basic Operations: = -++ Related Domains: -++ Also See: -++ AMS Classifications: -++ Keywords: equation -++ Examples: -++ References: -++ Description: -++ Equations as mathematical objects. All properties of the basis domain, -++ e.g. being an abelian group are carried over the equation domain, by -++ performing the structural operations on the left and on the -++ right hand side. --- The interpreter translates "=" to "equation". Otherwise, it will --- find a modemap for "=" in the domain of the arguments. - -Equation(S: Type): public == private where - Ex ==> OutputForm - public ==> Type with - "=": (S, S) -> $ - ++ a=b creates an equation. - equation: (S, S) -> $ - ++ equation(a,b) creates an equation. - swap: $ -> $ - ++ swap(eq) interchanges left and right hand side of equation eq. - lhs: $ -> S - ++ lhs(eqn) returns the left hand side of equation eqn. - rhs: $ -> S - ++ rhs(eqn) returns the right hand side of equation eqn. - map: (S -> S, $) -> $ - ++ map(f,eqn) constructs a new equation by applying f to both - ++ sides of eqn. - if S has InnerEvalable(Symbol,S) then - InnerEvalable(Symbol,S) - if S has SetCategory then - SetCategory - CoercibleTo Boolean - if S has Evalable(S) then - eval: ($, $) -> $ - ++ eval(eqn, x=f) replaces x by f in equation eqn. - eval: ($, List $) -> $ - ++ eval(eqn, [x1=v1, ... xn=vn]) replaces xi by vi in equation eqn. - if S has AbelianSemiGroup then - AbelianSemiGroup - "+": (S, $) -> $ - ++ x+eqn produces a new equation by adding x to both sides of - ++ equation eqn. - "+": ($, S) -> $ - ++ eqn+x produces a new equation by adding x to both sides of - ++ equation eqn. - if S has AbelianGroup then - AbelianGroup - leftZero : $ -> $ - ++ leftZero(eq) subtracts the left hand side. - rightZero : $ -> $ - ++ rightZero(eq) subtracts the right hand side. - "-": (S, $) -> $ - ++ x-eqn produces a new equation by subtracting both sides of - ++ equation eqn from x. - "-": ($, S) -> $ - ++ eqn-x produces a new equation by subtracting x from both sides of - ++ equation eqn. - if S has SemiGroup then - SemiGroup - "*": (S, $) -> $ - ++ x*eqn produces a new equation by multiplying both sides of - ++ equation eqn by x. - "*": ($, S) -> $ - ++ eqn*x produces a new equation by multiplying both sides of - ++ equation eqn by x. - if S has Monoid then - Monoid - leftOne : $ -> Union($,"failed") - ++ leftOne(eq) divides by the left hand side, if possible. - rightOne : $ -> Union($,"failed") - ++ rightOne(eq) divides by the right hand side, if possible. - if S has Group then - Group - leftOne : $ -> Union($,"failed") - ++ leftOne(eq) divides by the left hand side. - rightOne : $ -> Union($,"failed") - ++ rightOne(eq) divides by the right hand side. - if S has Ring then - Ring - BiModule(S,S) - if S has CommutativeRing then - Module(S) - --Algebra(S) - if S has IntegralDomain then - factorAndSplit : $ -> List $ - ++ factorAndSplit(eq) make the right hand side 0 and - ++ factors the new left hand side. Each factor is equated - ++ to 0 and put into the resulting list without repetitions. - if S has PartialDifferentialRing(Symbol) then - PartialDifferentialRing(Symbol) - if S has Field then - VectorSpace(S) - "/": ($, $) -> $ - ++ e1/e2 produces a new equation by dividing the left and right - ++ hand sides of equations e1 and e2. - inv: $ -> $ - ++ inv(x) returns the multiplicative inverse of x. - if S has ExpressionSpace then - subst: ($, $) -> $ - ++ subst(eq1,eq2) substitutes eq2 into both sides of eq1 - ++ the lhs of eq2 should be a kernel - - private ==> add - Rep := Record(lhs: S, rhs: S) - eq1,eq2: $ - s : S - if S has IntegralDomain then - factorAndSplit eq == - (S has factor : S -> Factored S) => - eq0 := rightZero eq - [equation(rcf.factor,0) for rcf in factors factor lhs eq0] - [eq] - l:S = r:S == [l, r] - equation(l, r) == [l, r] -- hack! See comment above. - lhs eqn == eqn.lhs - rhs eqn == eqn.rhs - swap eqn == [rhs eqn, lhs eqn] - map(fn, eqn) == equation(fn(eqn.lhs), fn(eqn.rhs)) - - if S has InnerEvalable(Symbol,S) then - s:Symbol - ls:List Symbol - x:S - lx:List S - eval(eqn,s,x) == eval(eqn.lhs,s,x) = eval(eqn.rhs,s,x) - eval(eqn,ls,lx) == eval(eqn.lhs,ls,lx) = eval(eqn.rhs,ls,lx) - if S has Evalable(S) then - eval(eqn1:$, eqn2:$):$ == - eval(eqn1.lhs, eqn2 pretend Equation S) = - eval(eqn1.rhs, eqn2 pretend Equation S) - eval(eqn1:$, leqn2:List $):$ == - eval(eqn1.lhs, leqn2 pretend List Equation S) = - eval(eqn1.rhs, leqn2 pretend List Equation S) - if S has SetCategory then - eq1 = eq2 == (eq1.lhs = eq2.lhs)@Boolean and - (eq1.rhs = eq2.rhs)@Boolean - coerce(eqn:$):Ex == eqn.lhs::Ex = eqn.rhs::Ex - coerce(eqn:$):Boolean == eqn.lhs = eqn.rhs - if S has AbelianSemiGroup then - eq1 + eq2 == eq1.lhs + eq2.lhs = eq1.rhs + eq2.rhs - s + eq2 == [s,s] + eq2 - eq1 + s == eq1 + [s,s] - if S has AbelianGroup then - - eq == (- lhs eq) = (-rhs eq) - s - eq2 == [s,s] - eq2 - eq1 - s == eq1 - [s,s] - leftZero eq == 0 = rhs eq - lhs eq - rightZero eq == lhs eq - rhs eq = 0 - 0 == equation(0$S,0$S) - eq1 - eq2 == eq1.lhs - eq2.lhs = eq1.rhs - eq2.rhs - if S has SemiGroup then - eq1:$ * eq2:$ == eq1.lhs * eq2.lhs = eq1.rhs * eq2.rhs - l:S * eqn:$ == l * eqn.lhs = l * eqn.rhs - l:S * eqn:$ == l * eqn.lhs = l * eqn.rhs - eqn:$ * l:S == eqn.lhs * l = eqn.rhs * l - -- We have to be a bit careful here: raising to a +ve integer is OK - -- (since it's the equivalent of repeated multiplication) - -- but other powers may cause contradictions - -- Watch what else you add here! JHD 2/Aug 1990 - if S has Monoid then - 1 == equation(1$S,1$S) - recip eq == - (lh := recip lhs eq) case "failed" => "failed" - (rh := recip rhs eq) case "failed" => "failed" - [lh :: S, rh :: S] - leftOne eq == - (re := recip lhs eq) case "failed" => "failed" - 1 = rhs eq * re - rightOne eq == - (re := recip rhs eq) case "failed" => "failed" - lhs eq * re = 1 - if S has Group then - inv eq == [inv lhs eq, inv rhs eq] - leftOne eq == 1 = rhs eq * inv rhs eq - rightOne eq == lhs eq * inv rhs eq = 1 - if S has Ring then - characteristic() == characteristic()$S - i:Integer * eq:$ == (i::S) * eq - if S has IntegralDomain then - factorAndSplit eq == - (S has factor : S -> Factored S) => - eq0 := rightZero eq - [equation(rcf.factor,0) for rcf in factors factor lhs eq0] - (S has Polynomial Integer) => - eq0 := rightZero eq - MF ==> MultivariateFactorize(Symbol, IndexedExponents Symbol, _ - Integer, Polynomial Integer) - p : Polynomial Integer := (lhs eq0) pretend Polynomial Integer - [equation((rcf.factor) pretend S,0) for rcf in factors factor(p)$MF] - [eq] - if S has PartialDifferentialRing(Symbol) then - differentiate(eq:$, sym:Symbol):$ == - [differentiate(lhs eq, sym), differentiate(rhs eq, sym)] - if S has Field then - dimension() == 2 :: CardinalNumber - eq1:$ / eq2:$ == eq1.lhs / eq2.lhs = eq1.rhs / eq2.rhs - inv eq == [inv lhs eq, inv rhs eq] - if S has ExpressionSpace then - subst(eq1,eq2) == - eq3 := eq2 pretend Equation S - [subst(lhs eq1,eq3),subst(rhs eq1,eq3)] - -@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain E04DGFA e04dgfAnnaType} \pagehead{e04dgfAnnaType}{E04DGFA} \pagepic{ps/v103e04dgfannatype.ps}{E04DGFA}{1.00} @@ -25119,6 +26145,885 @@ FullPartialFractionExpansion(F, UP): Exports == Implementation where %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Chapter G} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain GDMP GeneralDistributedMultivariatePolynomial} +<>= +-- gdpoly.spad.pamphlet GeneralDistributedMultivariatePolynomial.input +)spool GeneralDistributedMultivariatePolynomial.output +)set message test on +)set message auto off +)clear all +--S 1 of 10 +(d1,d2,d3) : DMP([z,y,x],FRAC INT) +--R +--R Type: Void +--E 1 + +--S 2 of 10 +d1 := -4*z + 4*y**2*x + 16*x**2 + 1 +--R +--R +--R 2 2 +--R (2) - 4z + 4y x + 16x + 1 +--R Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 2 + +--S 3 of 10 +d2 := 2*z*y**2 + 4*x + 1 +--R +--R +--R 2 +--R (3) 2z y + 4x + 1 +--R Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 3 + +--S 4 of 10 +d3 := 2*z*x**2 - 2*y**2 - x +--R +--R +--R 2 2 +--R (4) 2z x - 2y - x +--R Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 4 + +--S 5 of 10 +groebner [d1,d2,d3] +--R +--R +--R (5) +--R 1568 6 1264 5 6 4 182 3 2047 2 103 2857 +--R [z - ---- x - ---- x + --- x + --- x - ---- x - ---- x - -----, +--R 2745 305 305 549 610 2745 10980 +--R 2 112 6 84 5 1264 4 13 3 84 2 1772 2 +--R y + ---- x - --- x - ---- x - --- x + --- x + ---- x + ----, +--R 2745 305 305 549 305 2745 2745 +--R 7 29 6 17 4 11 3 1 2 15 1 +--R x + -- x - -- x - -- x + -- x + -- x + -] +--R 4 16 8 32 16 4 +--R Type: List DistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 5 + +--S 6 of 10 +(n1,n2,n3) : HDMP([z,y,x],FRAC INT) +--R +--R Type: Void +--E 6 + +--S 7 of 10 +n1 := d1 +--R +--R +--R 2 2 +--R (7) 4y x + 16x - 4z + 1 +--R Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 7 + +--S 8 of 10 +n2 := d2 +--R +--R +--R 2 +--R (8) 2z y + 4x + 1 +--R Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 8 + +--S 9 of 10 +n3 := d3 +--R +--R +--R 2 2 +--R (9) 2z x - 2y - x +--R Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 9 + +--S 10 of 10 +groebner [n1,n2,n3] +--R +--R +--R (10) +--R 4 3 3 2 1 1 4 29 3 1 2 7 9 1 +--R [y + 2x - - x + - z - -, x + -- x - - y - - z x - -- x - -, +--R 2 2 8 4 8 4 16 4 +--R 2 1 2 2 1 2 2 1 +--R z y + 2x + -, y x + 4x - z + -, z x - y - - x, +--R 2 4 2 +--R 2 2 2 1 3 +--R z - 4y + 2x - - z - - x] +--R 4 2 +--RType: List HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 10 +)spool +)lisp (bye) +@ + +<>= +==================================================================== +MultivariatePolynomial +DistributedMultivariatePolynomial +HomogeneousDistributedMultivariatePolynomial +GeneralDistributedMultivariatePolynomial +==================================================================== + +DistributedMultivariatePolynomial which is abbreviated as DMP and +HomogeneousDistributedMultivariatePolynomial, which is abbreviated +as HDMP, are very similar to MultivariatePolynomial except that +they are represented and displayed in a non-recursive manner. + + (d1,d2,d3) : DMP([z,y,x],FRAC INT) + Type: Void + +The constructor DMP orders its monomials lexicographically while +HDMP orders them by total order refined by reverse lexicographic +order. + + d1 := -4*z + 4*y**2*x + 16*x**2 + 1 + 2 2 + - 4z + 4y x + 16x + 1 + Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) + + d2 := 2*z*y**2 + 4*x + 1 + 2 + 2z y + 4x + 1 + Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) + + d3 := 2*z*x**2 - 2*y**2 - x + 2 2 + 2z x - 2y - x + Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) + +These constructors are mostly used in Groebner basis calculations. + + groebner [d1,d2,d3] + 1568 6 1264 5 6 4 182 3 2047 2 103 2857 + [z - ---- x - ---- x + --- x + --- x - ---- x - ---- x - -----, + 2745 305 305 549 610 2745 10980 + 2 112 6 84 5 1264 4 13 3 84 2 1772 2 + y + ---- x - --- x - ---- x - --- x + --- x + ---- x + ----, + 2745 305 305 549 305 2745 2745 + 7 29 6 17 4 11 3 1 2 15 1 + x + -- x - -- x - -- x + -- x + -- x + -] + 4 16 8 32 16 4 + Type: List DistributedMultivariatePolynomial([z,y,x],Fraction Integer) + + (n1,n2,n3) : HDMP([z,y,x],FRAC INT) + Type: Void + + n1 := d1 + 2 2 + 4y x + 16x - 4z + 1 + Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) + + n2 := d2 + 2 + 2z y + 4x + 1 + Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) + + n3 := d3 + 2 2 + 2z x - 2y - x + Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) + +Note that we get a different Groebner basis when we use the HDMP +polynomials, as expected. + + groebner [n1,n2,n3] + 4 3 3 2 1 1 4 29 3 1 2 7 9 1 + [y + 2x - - x + - z - -, x + -- x - - y - - z x - -- x - -, + 2 2 8 4 8 4 16 4 + 2 1 2 2 1 2 2 1 + z y + 2x + -, y x + 4x - z + -, z x - y - - x, + 2 4 2 + 2 2 2 1 3 + z - 4y + 2x - - z - - x] + 4 2 + Type: List HomogeneousDistributedMultivariatePolynomial([z,y,x], + Fraction Integer) + +GeneralDistributedMultivariatePolynomial is somewhat more flexible in +the sense that as well as accepting a list of variables to specify the +variable ordering, it also takes a predicate on exponent vectors to +specify the term ordering. With this polynomial type the user can +experiment with the effect of using completely arbitrary term orderings. +This flexibility is mostly important for algorithms such as Groebner +basis calculations which can be very sensitive to term ordering. + +See Also: +o )help Polynomial +o )help UnivariatePolynomial +o )help MultivariatePolynomial +o )help HomogeneousDistributedMultivariatePolynomial +o )help DistributedMultivariatePolynomial +o )show GeneralDistributedMultivariatePolynomial +o $AXIOM/doc/src/algebra/gdpoly.spad.dvi + +@ +\pagehead{GeneralDistributedMultivariatePolynomial}{GDMP} +\pagepic{ps/v103generaldistributedmultivariatepolynomial.ps}{GDMP}{1.00} +See also:\\ +\refto{DistributedMultivariatePolynomial}{DMP} +\refto{HomogeneousDistributedMultivariatePolynomial}{HDMP} +<>= +)abbrev domain GDMP GeneralDistributedMultivariatePolynomial +++ Author: Barry Trager +++ Date Created: +++ Date Last Updated: +++ Basic Functions: Ring, degree, eval, coefficient, monomial, differentiate, +++ resultant, gcd, leadingCoefficient +++ Related Constructors: DistributedMultivariatePolynomial, +++ HomogeneousDistributedMultivariatePolynomial +++ Also See: Polynomial +++ AMS Classifications: +++ Keywords: polynomial, multivariate, distributed +++ References: +++ Description: +++ This type supports distributed multivariate polynomials +++ whose variables are from a user specified list of symbols. +++ The coefficient ring may be non commutative, +++ but the variables are assumed to commute. +++ The term ordering is specified by its third parameter. +++ Suggested types which define term orderings include: \spadtype{DirectProduct}, +++ \spadtype{HomogeneousDirectProduct}, \spadtype{SplitHomogeneousDirectProduct} +++ and finally \spadtype{OrderedDirectProduct} which accepts an arbitrary user +++ function to define a term ordering. + +GeneralDistributedMultivariatePolynomial(vl,R,E): public == private where + vl: List Symbol + R: Ring + E: DirectProductCategory(#vl,NonNegativeInteger) + OV ==> OrderedVariableList(vl) + SUP ==> SparseUnivariatePolynomial + NNI ==> NonNegativeInteger + + public == PolynomialCategory(R,E,OV) with + reorder: (%,List Integer) -> % + ++ reorder(p, perm) applies the permutation perm to the variables + ++ in a polynomial and returns the new correctly ordered polynomial + + private == PolynomialRing(R,E) add + --representations + Term := Record(k:E,c:R) + Rep := List Term + n := #vl + Vec ==> Vector(NonNegativeInteger) + zero?(p : %): Boolean == null(p : Rep) + + totalDegree p == + zero? p => 0 + "max"/[reduce("+",(t.k)::(Vector NNI), 0) for t in p] + + monomial(p:%, v: OV,e: NonNegativeInteger):% == + locv := lookup v + p*monomial(1, + directProduct [if z=locv then e else 0 for z in 1..n]$Vec) + + coerce(v: OV):% == monomial(1,v,1) + + listCoef(p : %): List R == + rec : Term + [rec.c for rec in (p:Rep)] + + mainVariable(p: %) == + zero?(p) => "failed" + for v in vl repeat + vv := variable(v)::OV + if degree(p,vv)>0 then return vv + "failed" + + ground?(p) == mainVariable(p) case "failed" + + retract(p : %): R == + not ground? p => error "not a constant" + leadingCoefficient p + + retractIfCan(p : %): Union(R,"failed") == + ground?(p) => leadingCoefficient p + "failed" + + degree(p: %,v: OV) == degree(univariate(p,v)) + minimumDegree(p: %,v: OV) == minimumDegree(univariate(p,v)) + differentiate(p: %,v: OV) == + multivariate(differentiate(univariate(p,v)),v) + + degree(p: %,lv: List OV) == [degree(p,v) for v in lv] + minimumDegree(p: %,lv: List OV) == [minimumDegree(p,v) for v in lv] + + numberOfMonomials(p:%) == + l : Rep := p : Rep + null(l) => 1 + #l + + monomial?(p : %): Boolean == + l : Rep := p : Rep + null(l) or null rest(l) + + if R has OrderedRing then + maxNorm(p : %): R == + l : List R := nil + r,m : R + m := 0 + for r in listCoef(p) repeat + if r > m then m := r + else if (-r) > m then m := -r + m + + --trailingCoef(p : %) == + -- l : Rep := p : Rep + -- null l => 0 + -- r : Term := last l + -- r.c + + --leadingPrimitiveMonomial(p : %) == + -- ground?(p) => 1$% + -- r : Term := first(p:Rep) + -- r := [r.k,1$R]$Term -- new cell + -- list(r)$Rep :: % + + -- The following 2 defs are inherited from PolynomialRing + + --leadingMonomial(p : %) == + -- ground?(p) => p + -- r : Term := first(p:Rep) + -- r := [r.k,r.c]$Term -- new cell + -- list(r)$Rep :: % + + --reductum(p : %): % == + -- ground? p => 0$% + -- (rest(p:Rep)):% + + if R has Field then + (p : %) / (r : R) == inv(r) * p + + variables(p: %) == + maxdeg:Vector(NonNegativeInteger) := new(n,0) + while not zero?(p) repeat + tdeg := degree p + p := reductum p + for i in 1..n repeat + maxdeg.i := max(maxdeg.i, tdeg.i) + [index(i:PositiveInteger) for i in 1..n | maxdeg.i^=0] + + reorder(p: %,perm: List Integer):% == + #perm ^= n => error "must be a complete permutation of all vars" + q := [[directProduct [term.k.j for j in perm]$Vec,term.c]$Term + for term in p] + sort(#1.k > #2.k,q) + + --coerce(dp:DistributedMultivariatePolynomial(vl,R)):% == + -- q:=dp:List(Term) + -- sort(#1.k > #2.k,q):% + + univariate(p: %,v: OV):SUP(%) == + zero?(p) => 0 + exp := degree p + locv := lookup v + deg:NonNegativeInteger := 0 + nexp := directProduct [if i=locv then (deg :=exp.i;0) else exp.i + for i in 1..n]$Vec + monomial(monomial(leadingCoefficient p,nexp),deg)+ + univariate(reductum p,v) + + eval(p: %,v: OV,val:%):% == univariate(p,v)(val) + + eval(p: %,v: OV,val:R):% == eval(p,v,val::%)$% + + eval(p: %,lv: List OV,lval: List R):% == + lv = [] => p + eval(eval(p,first lv,(first lval)::%)$%, rest lv, rest lval)$% + + -- assume Lvar are sorted correctly + evalSortedVarlist(p: %,Lvar: List OV,Lpval: List %):% == + v := mainVariable p + v case "failed" => p + pv := v:: OV + Lvar=[] or Lpval=[] => p + mvar := Lvar.first + mvar > pv => evalSortedVarlist(p,Lvar.rest,Lpval.rest) + pval := Lpval.first + pts:SUP(%):= map(evalSortedVarlist(#1,Lvar,Lpval),univariate(p,pv)) + mvar=pv => pts(pval) + multivariate(pts,pv) + + eval(p:%,Lvar:List OV,Lpval:List %) == + nlvar:List OV := sort(#1 > #2,Lvar) + nlpval := + Lvar = nlvar => Lpval + nlpval := [Lpval.position(mvar,Lvar) for mvar in nlvar] + evalSortedVarlist(p,nlvar,nlpval) + + multivariate(p1:SUP(%),v: OV):% == + 0=p1 => 0 + degree p1 = 0 => leadingCoefficient p1 + leadingCoefficient(p1)*(v::%)**degree(p1) + + multivariate(reductum p1,v) + + univariate(p: %):SUP(R) == + (v := mainVariable p) case "failed" => + monomial(leadingCoefficient p,0) + q := univariate(p,v:: OV) + ans:SUP(R) := 0 + while q ^= 0 repeat + ans := ans + monomial(ground leadingCoefficient q,degree q) + q := reductum q + ans + + multivariate(p:SUP(R),v: OV):% == + 0=p => 0 + (leadingCoefficient p)*monomial(1,v,degree p) + + multivariate(reductum p,v) + + if R has GcdDomain then + content(p: %):R == + zero?(p) => 0 + "gcd"/[t.c for t in p] + + + + if R has EuclideanDomain and not(R has FloatingPointSystem) then + gcd(p: %,q:%):% == + gcd(p,q)$PolynomialGcdPackage(E,OV,R,%) + + else gcd(p: %,q:%):% == + r : R + (pv := mainVariable(p)) case "failed" => + (r := leadingCoefficient p) = 0$R => q + gcd(r,content q)::% + (qv := mainVariable(q)) case "failed" => + (r := leadingCoefficient q) = 0$R => p + gcd(r,content p)::% + pv gcd(p,content univariate(q,qv)) + qv gcd(q,content univariate(p,pv)) + multivariate(gcd(univariate(p,pv),univariate(q,qv)),pv) + + coerce(p: %) : OutputForm == + zero?(p) => (0$R) :: OutputForm + l,lt : List OutputForm + lt := nil + vl1 := [v::OutputForm for v in vl] + for t in reverse p repeat + l := nil + for i in 1..#vl1 repeat + t.k.i = 0 => l + t.k.i = 1 => l := cons(vl1.i,l) + l := cons(vl1.i ** t.k.i ::OutputForm,l) + l := reverse l + if (t.c ^= 1) or (null l) then l := cons(t.c :: OutputForm,l) + 1 = #l => lt := cons(first l,lt) + lt := cons(reduce("*",l),lt) + 1 = #lt => first lt + reduce("+",lt) + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain GCNAALG GenericNonAssociativeAlgebra} +\pagehead{GenericNonAssociativeAlgebra}{GCNAALG} +\pagepic{ps/v103genericnonassociativealgebra.ps}{GCNAALG}{1.00} +<>= +)abbrev domain GCNAALG GenericNonAssociativeAlgebra +++ Authors: J. Grabmeier, R. Wisbauer +++ Date Created: 26 June 1991 +++ Date Last Updated: 26 June 1991 +++ Basic Operations: generic +++ Related Constructors: AlgebraPackage +++ Also See: +++ AMS Classifications: +++ Keywords: generic element. rank polynomial +++ Reference: +++ A. Woerz-Busekros: Algebra in Genetics +++ Lectures Notes in Biomathematics 36, +++ Springer-Verlag, Heidelberg, 1980 +++ Description: +++ AlgebraGenericElementPackage allows you to create generic elements +++ of an algebra, i.e. the scalars are extended to include symbolic +++ coefficients +GenericNonAssociativeAlgebra(R : CommutativeRing, n : PositiveInteger,_ + ls : List Symbol, gamma: Vector Matrix R ): public == private where + + NNI ==> NonNegativeInteger + V ==> Vector + PR ==> Polynomial R + FPR ==> Fraction Polynomial R + SUP ==> SparseUnivariatePolynomial + S ==> Symbol + + public ==> Join(FramedNonAssociativeAlgebra(FPR), _ + LeftModule(SquareMatrix(n,FPR)) ) with + + coerce : Vector FPR -> % + ++ coerce(v) assumes that it is called with a vector + ++ of length equal to the dimension of the algebra, then + ++ a linear combination with the basis element is formed + leftUnits:() -> Union(Record(particular: %, basis: List %), "failed") + ++ leftUnits() returns the affine space of all left units of the + ++ algebra, or \spad{"failed"} if there is none + rightUnits:() -> Union(Record(particular: %, basis: List %), "failed") + ++ rightUnits() returns the affine space of all right units of the + ++ algebra, or \spad{"failed"} if there is none + generic : () -> % + ++ generic() returns a generic element, i.e. the linear combination + ++ of the fixed basis with the symbolic coefficients + ++ \spad{%x1,%x2,..} + generic : Symbol -> % + ++ generic(s) returns a generic element, i.e. the linear combination + ++ of the fixed basis with the symbolic coefficients + ++ \spad{s1,s2,..} + generic : Vector Symbol -> % + ++ generic(vs) returns a generic element, i.e. the linear combination + ++ of the fixed basis with the symbolic coefficients + ++ \spad{vs}; + ++ error, if the vector of symbols is too short + generic : Vector % -> % + ++ generic(ve) returns a generic element, i.e. the linear combination + ++ of \spad{ve} basis with the symbolic coefficients + ++ \spad{%x1,%x2,..} + generic : (Symbol, Vector %) -> % + ++ generic(s,v) returns a generic element, i.e. the linear combination + ++ of v with the symbolic coefficients + ++ \spad{s1,s2,..} + generic : (Vector Symbol, Vector %) -> % + ++ generic(vs,ve) returns a generic element, i.e. the linear combination + ++ of \spad{ve} with the symbolic coefficients \spad{vs} + ++ error, if the vector of symbols is shorter than the vector of + ++ elements + if R has IntegralDomain then + leftRankPolynomial : () -> SparseUnivariatePolynomial FPR + ++ leftRankPolynomial() returns the left minimimal polynomial + ++ of the generic element + genericLeftMinimalPolynomial : % -> SparseUnivariatePolynomial FPR + ++ genericLeftMinimalPolynomial(a) substitutes the coefficients + ++ of {em a} for the generic coefficients in + ++ \spad{leftRankPolynomial()} + genericLeftTrace : % -> FPR + ++ genericLeftTrace(a) substitutes the coefficients + ++ of \spad{a} for the generic coefficients into the + ++ coefficient of the second highest term in + ++ \spadfun{leftRankPolynomial} and changes the sign. + ++ This is a linear form + genericLeftNorm : % -> FPR + ++ genericLeftNorm(a) substitutes the coefficients + ++ of \spad{a} for the generic coefficients into the + ++ coefficient of the constant term in \spadfun{leftRankPolynomial} + ++ and changes the sign if the degree of this polynomial is odd. + ++ This is a form of degree k + rightRankPolynomial : () -> SparseUnivariatePolynomial FPR + ++ rightRankPolynomial() returns the right minimimal polynomial + ++ of the generic element + genericRightMinimalPolynomial : % -> SparseUnivariatePolynomial FPR + ++ genericRightMinimalPolynomial(a) substitutes the coefficients + ++ of \spad{a} for the generic coefficients in + ++ \spadfun{rightRankPolynomial} + genericRightTrace : % -> FPR + ++ genericRightTrace(a) substitutes the coefficients + ++ of \spad{a} for the generic coefficients into the + ++ coefficient of the second highest term in + ++ \spadfun{rightRankPolynomial} and changes the sign + genericRightNorm : % -> FPR + ++ genericRightNorm(a) substitutes the coefficients + ++ of \spad{a} for the generic coefficients into the + ++ coefficient of the constant term in \spadfun{rightRankPolynomial} + ++ and changes the sign if the degree of this polynomial is odd + genericLeftTraceForm : (%,%) -> FPR + ++ genericLeftTraceForm (a,b) is defined to be + ++ \spad{genericLeftTrace (a*b)}, this defines + ++ a symmetric bilinear form on the algebra + genericLeftDiscriminant: () -> FPR + ++ genericLeftDiscriminant() is the determinant of the + ++ generic left trace forms of all products of basis element, + ++ if the generic left trace form is associative, an algebra + ++ is separable if the generic left discriminant is invertible, + ++ if it is non-zero, there is some ring extension which + ++ makes the algebra separable + genericRightTraceForm : (%,%) -> FPR + ++ genericRightTraceForm (a,b) is defined to be + ++ \spadfun{genericRightTrace (a*b)}, this defines + ++ a symmetric bilinear form on the algebra + genericRightDiscriminant: () -> FPR + ++ genericRightDiscriminant() is the determinant of the + ++ generic left trace forms of all products of basis element, + ++ if the generic left trace form is associative, an algebra + ++ is separable if the generic left discriminant is invertible, + ++ if it is non-zero, there is some ring extension which + ++ makes the algebra separable + conditionsForIdempotents: Vector % -> List Polynomial R + ++ conditionsForIdempotents([v1,...,vn]) determines a complete list + ++ of polynomial equations for the coefficients of idempotents + ++ with respect to the \spad{R}-module basis \spad{v1},...,\spad{vn} + conditionsForIdempotents: () -> List Polynomial R + ++ conditionsForIdempotents() determines a complete list + ++ of polynomial equations for the coefficients of idempotents + ++ with respect to the fixed \spad{R}-module basis + + private ==> AlgebraGivenByStructuralConstants(FPR,n,ls,_ + coerce(gamma)$CoerceVectorMatrixPackage(R) ) add + + listOfNumbers : List String := [STRINGIMAGE(q)$Lisp for q in 1..n] + symbolsForCoef : V Symbol := + [concat("%", concat("x", i))::Symbol for i in listOfNumbers] + genericElement : % := + v : Vector PR := + [monomial(1$PR, [symbolsForCoef.i],[1]) for i in 1..n] + convert map(coerce,v)$VectorFunctions2(PR,FPR) + + eval : (FPR, %) -> FPR + eval(rf,a) == + -- for the moment we only substitute the numerators + -- of the coefficients + coefOfa : List PR := + map(numer, entries coordinates a)$ListFunctions2(FPR,PR) + ls : List PR :=[monomial(1$PR, [s],[1]) for s in entries symbolsForCoef] + lEq : List Equation PR := [] + for i in 1..maxIndex ls repeat + lEq := cons(equation(ls.i,coefOfa.i)$Equation(PR) , lEq) + top : PR := eval(numer(rf),lEq)$PR + bot : PR := eval(numer(rf),lEq)$PR + top/bot + + + if R has IntegralDomain then + + genericLeftTraceForm(a,b) == genericLeftTrace(a*b) + genericLeftDiscriminant() == + listBasis : List % := entries basis()$% + m : Matrix FPR := matrix + [[genericLeftTraceForm(a,b) for a in listBasis] for b in listBasis] + determinant m + + genericRightTraceForm(a,b) == genericRightTrace(a*b) + genericRightDiscriminant() == + listBasis : List % := entries basis()$% + m : Matrix FPR := matrix + [[genericRightTraceForm(a,b) for a in listBasis] for b in listBasis] + determinant m + + + + leftRankPoly : SparseUnivariatePolynomial FPR := 0 + initLeft? : Boolean :=true + + initializeLeft: () -> Void + initializeLeft() == + -- reset initialize flag + initLeft?:=false + leftRankPoly := leftMinimalPolynomial genericElement + void()$Void + + rightRankPoly : SparseUnivariatePolynomial FPR := 0 + initRight? : Boolean :=true + + initializeRight: () -> Void + initializeRight() == + -- reset initialize flag + initRight?:=false + rightRankPoly := rightMinimalPolynomial genericElement + void()$Void + + leftRankPolynomial() == + if initLeft? then initializeLeft() + leftRankPoly + + rightRankPolynomial() == + if initRight? then initializeRight() + rightRankPoly + + genericLeftMinimalPolynomial a == + if initLeft? then initializeLeft() + map(eval(#1,a),leftRankPoly)$SUP(FPR) + + genericRightMinimalPolynomial a == + if initRight? then initializeRight() + map(eval(#1,a),rightRankPoly)$SUP(FPR) + + genericLeftTrace a == + if initLeft? then initializeLeft() + d1 : NNI := (degree leftRankPoly - 1) :: NNI + rf : FPR := coefficient(leftRankPoly, d1) + rf := eval(rf,a) + - rf + + genericRightTrace a == + if initRight? then initializeRight() + d1 : NNI := (degree rightRankPoly - 1) :: NNI + rf : FPR := coefficient(rightRankPoly, d1) + rf := eval(rf,a) + - rf + + genericLeftNorm a == + if initLeft? then initializeLeft() + rf : FPR := coefficient(leftRankPoly, 1) + if odd? degree leftRankPoly then rf := - rf + rf + + genericRightNorm a == + if initRight? then initializeRight() + rf : FPR := coefficient(rightRankPoly, 1) + if odd? degree rightRankPoly then rf := - rf + rf + + conditionsForIdempotents(b: V %) : List Polynomial R == + x : % := generic(b) + map(numer,entries coordinates(x*x-x,b))$ListFunctions2(FPR,PR) + + conditionsForIdempotents(): List Polynomial R == + x : % := genericElement + map(numer,entries coordinates(x*x-x))$ListFunctions2(FPR,PR) + + generic() == genericElement + + generic(vs:V S, ve: V %): % == + maxIndex v > maxIndex ve => + error "generic: too little symbols" + v : Vector PR := + [monomial(1$PR, [vs.i],[1]) for i in 1..maxIndex ve] + represents(map(coerce,v)$VectorFunctions2(PR,FPR),ve) + + generic(s: S, ve: V %): % == + lON : List String := [STRINGIMAGE(q)$Lisp for q in 1..maxIndex ve] + sFC : Vector Symbol := + [concat(s pretend String, i)::Symbol for i in lON] + generic(sFC, ve) + + generic(ve : V %) == + lON : List String := [STRINGIMAGE(q)$Lisp for q in 1..maxIndex ve] + sFC : Vector Symbol := + [concat("%", concat("x", i))::Symbol for i in lON] + v : Vector PR := + [monomial(1$PR, [sFC.i],[1]) for i in 1..maxIndex ve] + represents(map(coerce,v)$VectorFunctions2(PR,FPR),ve) + + generic(vs:V S): % == generic(vs, basis()$%) + + generic(s: S): % == generic(s, basis()$%) + + -- variations on eval + --coefOfa : List FPR := entries coordinates a + --ls : List Symbol := entries symbolsForCoef + -- a very dangerous sequential implementation for the moment, + -- because the compiler doesn't manage the parallel code + -- also doesn't run: + -- not known that (Fraction (Polynomial R)) has (has (Polynomial R) + -- (Evalable (Fraction (Polynomial R)))) + --res : FPR := rf + --for eq in lEq repeat res := eval(res,eq)$FPR + --res + --rf + --eval(rf, le)$FPR + --eval(rf, entries symbolsForCoef, coefOfa)$FPR + --eval(rf, ls, coefOfa)$FPR + --le : List Equation PR := [equation(lh,rh) for lh in ls for rh in coefOfa] + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain GSERIES GeneralUnivariatePowerSeries} +\pagehead{GeneralUnivariatePowerSeries}{GSERIES} +\pagepic{ps/v103generalunivariatepowerseries.ps}{GSERIES}{1.00} +<>= +)abbrev domain GSERIES GeneralUnivariatePowerSeries +++ Author: Clifton J. Williamson +++ Date Created: 22 September 1993 +++ Date Last Updated: 23 September 1993 +++ Basic Operations: +++ Related Domains: +++ Also See: +++ AMS Classifications: +++ Keywords: series, Puiseux +++ Examples: +++ References: +++ Description: +++ This is a category of univariate Puiseux series constructed +++ from univariate Laurent series. A Puiseux series is represented +++ by a pair \spad{[r,f(x)]}, where r is a positive rational number and +++ \spad{f(x)} is a Laurent series. This pair represents the Puiseux +++ series \spad{f(x\^r)}. +GeneralUnivariatePowerSeries(Coef,var,cen): Exports == Implementation where + Coef : Ring + var : Symbol + cen : Coef + I ==> Integer + UTS ==> UnivariateTaylorSeries + ULS ==> UnivariateLaurentSeries + UPXS ==> UnivariatePuiseuxSeries + EFULS ==> ElementaryFunctionsUnivariateLaurentSeries + EFUPXS ==> ElementaryFunctionsUnivariatePuiseuxSeries + FS2UPS ==> FunctionSpaceToUnivariatePowerSeries + + Exports ==> UnivariatePuiseuxSeriesCategory Coef with + coerce: Variable(var) -> % + ++ coerce(var) converts the series variable \spad{var} into a + ++ Puiseux series. + coerce: UPXS(Coef,var,cen) -> % + ++ coerce(f) converts a Puiseux series to a general power series. + differentiate: (%,Variable(var)) -> % + ++ \spad{differentiate(f(x),x)} returns the derivative of + ++ \spad{f(x)} with respect to \spad{x}. + if Coef has Algebra Fraction Integer then + integrate: (%,Variable(var)) -> % + ++ \spad{integrate(f(x))} returns an anti-derivative of the power + ++ series \spad{f(x)} with constant coefficient 0. + ++ We may integrate a series when we can divide coefficients + ++ by integers. + + Implementation ==> UnivariatePuiseuxSeries(Coef,var,cen) add + + coerce(upxs:UPXS(Coef,var,cen)) == upxs pretend % + + puiseux: % -> UPXS(Coef,var,cen) + puiseux f == f pretend UPXS(Coef,var,cen) + + if Coef has Algebra Fraction Integer then + + differentiate f == + str1 : String := "'differentiate' unavailable on this domain; " + str2 : String := "use 'approximate' first" + error concat(str1,str2) + + differentiate(f:%,v:Variable(var)) == differentiate f + + if Coef has PartialDifferentialRing(Symbol) then + differentiate(f:%,s:Symbol) == + (s = variable(f)) => + str1 : String := "'differentiate' unavailable on this domain; " + str2 : String := "use 'approximate' first" + error concat(str1,str2) + dcds := differentiate(center f,s) + deriv := differentiate(puiseux f) :: % + map(differentiate(#1,s),f) - dcds * deriv + + integrate f == + str1 : String := "'integrate' unavailable on this domain; " + str2 : String := "use 'approximate' first" + error concat(str1,str2) + + integrate(f:%,v:Variable(var)) == integrate f + + if Coef has integrate: (Coef,Symbol) -> Coef and _ + Coef has variables: Coef -> List Symbol then + + integrate(f:%,s:Symbol) == + (s = variable(f)) => + str1 : String := "'integrate' unavailable on this domain; " + str2 : String := "use 'approximate' first" + error concat(str1,str2) + not entry?(s,variables center f) => map(integrate(#1,s),f) + error "integrate: center is a function of variable of integration" + + if Coef has TranscendentalFunctionCategory and _ + Coef has PrimitiveFunctionCategory and _ + Coef has AlgebraicallyClosedFunctionSpace Integer then + + integrateWithOneAnswer: (Coef,Symbol) -> Coef + integrateWithOneAnswer(f,s) == + res := integrate(f,s)$FunctionSpaceIntegration(Integer,Coef) + res case Coef => res :: Coef + first(res :: List Coef) + + integrate(f:%,s:Symbol) == + (s = variable(f)) => + str1 : String := "'integrate' unavailable on this domain; " + str2 : String := "use 'approximate' first" + error concat(str1,str2) + not entry?(s,variables center f) => + map(integrateWithOneAnswer(#1,s),f) + error "integrate: center is a function of variable of integration" + +@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Chapter H} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -25350,6 +27255,304 @@ Heap(S:OrderedSet): Exports == Implementation where @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain HDP HomogeneousDirectProduct} +\pagehead{HomogeneousDirectProduct}{HDP} +\pagepic{ps/v103homogeneousdirectproduct.ps}{HDP}{1.00} +See also:\\ +\refto{OrderedDirectProduct}{ODP} +\refto{SplitHomogeneousDirectProduct}{SHDP} +<>= +)abbrev domain HDP HomogeneousDirectProduct +++ Author: +++ Date Created: +++ Date Last Updated: +++ Basic Functions: +++ Related Constructors: Vector, DirectProduct +++ Also See: OrderedDirectProduct, SplitHomogeneousDirectproduct +++ AMS Classifications: +++ Keywords: +++ References: +++ Description: +++ This type represents the finite direct or cartesian product of an +++ underlying ordered component type. The vectors are ordered first +++ by the sum of their components, and then refined using a reverse +++ lexicographic ordering. This type is a suitable third argument for +++ \spadtype{GeneralDistributedMultivariatePolynomial}. + +HomogeneousDirectProduct(dim,S) : T == C where + dim : NonNegativeInteger + S : OrderedAbelianMonoidSup + + T == DirectProductCategory(dim,S) + C == DirectProduct(dim,S) add + Rep:=Vector(S) + v1:% < v2:% == + -- reverse lexicographical ordering + n1:S:=0 + n2:S:=0 + for i in 1..dim repeat + n1:= n1+qelt(v1,i) + n2:=n2+qelt(v2,i) + n1 true + n2 false + for i in reverse(1..dim) repeat + if qelt(v2,i) < qelt(v1,i) then return true + if qelt(v1,i) < qelt(v2,i) then return false + false + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain HDMP HomogeneousDistributedMultivariatePolynomial} +<>= +-- gdpoly.spad.pamphlet HomogeneousDistributedMultivariatePolynomial.input +)spool HomogeneousDistributedMultivariatePolynomial.output +)set message test on +)set message auto off +)clear all +--S 1 of 10 +(d1,d2,d3) : DMP([z,y,x],FRAC INT) +--R +--R Type: Void +--E 1 + +--S 2 of 10 +d1 := -4*z + 4*y**2*x + 16*x**2 + 1 +--R +--R +--R 2 2 +--R (2) - 4z + 4y x + 16x + 1 +--R Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 2 + +--S 3 of 10 +d2 := 2*z*y**2 + 4*x + 1 +--R +--R +--R 2 +--R (3) 2z y + 4x + 1 +--R Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 3 + +--S 4 of 10 +d3 := 2*z*x**2 - 2*y**2 - x +--R +--R +--R 2 2 +--R (4) 2z x - 2y - x +--R Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 4 + +--S 5 of 10 +groebner [d1,d2,d3] +--R +--R +--R (5) +--R 1568 6 1264 5 6 4 182 3 2047 2 103 2857 +--R [z - ---- x - ---- x + --- x + --- x - ---- x - ---- x - -----, +--R 2745 305 305 549 610 2745 10980 +--R 2 112 6 84 5 1264 4 13 3 84 2 1772 2 +--R y + ---- x - --- x - ---- x - --- x + --- x + ---- x + ----, +--R 2745 305 305 549 305 2745 2745 +--R 7 29 6 17 4 11 3 1 2 15 1 +--R x + -- x - -- x - -- x + -- x + -- x + -] +--R 4 16 8 32 16 4 +--R Type: List DistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 5 + +--S 6 of 10 +(n1,n2,n3) : HDMP([z,y,x],FRAC INT) +--R +--R Type: Void +--E 6 + +--S 7 of 10 +n1 := d1 +--R +--R +--R 2 2 +--R (7) 4y x + 16x - 4z + 1 +--R Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 7 + +--S 8 of 10 +n2 := d2 +--R +--R +--R 2 +--R (8) 2z y + 4x + 1 +--R Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 8 + +--S 9 of 10 +n3 := d3 +--R +--R +--R 2 2 +--R (9) 2z x - 2y - x +--R Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 9 + +--S 10 of 10 +groebner [n1,n2,n3] +--R +--R +--R (10) +--R 4 3 3 2 1 1 4 29 3 1 2 7 9 1 +--R [y + 2x - - x + - z - -, x + -- x - - y - - z x - -- x - -, +--R 2 2 8 4 8 4 16 4 +--R 2 1 2 2 1 2 2 1 +--R z y + 2x + -, y x + 4x - z + -, z x - y - - x, +--R 2 4 2 +--R 2 2 2 1 3 +--R z - 4y + 2x - - z - - x] +--R 4 2 +--RType: List HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) +--E 10 +)spool +)lisp (bye) +@ + +<>= +==================================================================== +MultivariatePolynomial +DistributedMultivariatePolynomial +HomogeneousDistributedMultivariatePolynomial +GeneralDistributedMultivariatePolynomial +==================================================================== + +DistributedMultivariatePolynomial which is abbreviated as DMP and +HomogeneousDistributedMultivariatePolynomial, which is abbreviated +as HDMP, are very similar to MultivariatePolynomial except that +they are represented and displayed in a non-recursive manner. + + (d1,d2,d3) : DMP([z,y,x],FRAC INT) + Type: Void + +The constructor DMP orders its monomials lexicographically while +HDMP orders them by total order refined by reverse lexicographic +order. + + d1 := -4*z + 4*y**2*x + 16*x**2 + 1 + 2 2 + - 4z + 4y x + 16x + 1 + Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) + + d2 := 2*z*y**2 + 4*x + 1 + 2 + 2z y + 4x + 1 + Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) + + d3 := 2*z*x**2 - 2*y**2 - x + 2 2 + 2z x - 2y - x + Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) + +These constructors are mostly used in Groebner basis calculations. + + groebner [d1,d2,d3] + 1568 6 1264 5 6 4 182 3 2047 2 103 2857 + [z - ---- x - ---- x + --- x + --- x - ---- x - ---- x - -----, + 2745 305 305 549 610 2745 10980 + 2 112 6 84 5 1264 4 13 3 84 2 1772 2 + y + ---- x - --- x - ---- x - --- x + --- x + ---- x + ----, + 2745 305 305 549 305 2745 2745 + 7 29 6 17 4 11 3 1 2 15 1 + x + -- x - -- x - -- x + -- x + -- x + -] + 4 16 8 32 16 4 + Type: List DistributedMultivariatePolynomial([z,y,x],Fraction Integer) + + (n1,n2,n3) : HDMP([z,y,x],FRAC INT) + Type: Void + + n1 := d1 + 2 2 + 4y x + 16x - 4z + 1 + Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) + + n2 := d2 + 2 + 2z y + 4x + 1 + Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) + + n3 := d3 + 2 2 + 2z x - 2y - x + Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) + +Note that we get a different Groebner basis when we use the HDMP +polynomials, as expected. + + groebner [n1,n2,n3] + 4 3 3 2 1 1 4 29 3 1 2 7 9 1 + [y + 2x - - x + - z - -, x + -- x - - y - - z x - -- x - -, + 2 2 8 4 8 4 16 4 + 2 1 2 2 1 2 2 1 + z y + 2x + -, y x + 4x - z + -, z x - y - - x, + 2 4 2 + 2 2 2 1 3 + z - 4y + 2x - - z - - x] + 4 2 + Type: List HomogeneousDistributedMultivariatePolynomial([z,y,x], + Fraction Integer) + +GeneralDistributedMultivariatePolynomial is somewhat more flexible in +the sense that as well as accepting a list of variables to specify the +variable ordering, it also takes a predicate on exponent vectors to +specify the term ordering. With this polynomial type the user can +experiment with the effect of using completely arbitrary term orderings. +This flexibility is mostly important for algorithms such as Groebner +basis calculations which can be very sensitive to term ordering. + +See Also: +o )help Polynomial +o )help UnivariatePolynomial +o )help MultivariatePolynomial +o )help DistributedMultivariatePolynomial +o )help GeneralDistributedMultivariatePolynomial +o )show HomogeneousDistributedMultivariatePolynomial +o $AXIOM/doc/src/algebra/gdpoly.spad.dvi + +@ +\pagehead{HomogeneousDistributedMultivariatePolynomial}{HDMP} +\pagepic{ps/v103homogeneousdistributedmultivariatepolynomial.ps}{HDMP}{1.00} +See also:\\ +\refto{GeneralDistributedMultivariatePolynomial}{GDMP} +\refto{DistributedMultivariatePolynomial}{DMP} +<>= +)abbrev domain HDMP HomogeneousDistributedMultivariatePolynomial +++ Author: Barry Trager +++ Date Created: +++ Date Last Updated: +++ Basic Functions: Ring, degree, eval, coefficient, monomial, differentiate, +++ resultant, gcd, leadingCoefficient +++ Related Constructors: DistributedMultivariatePolynomial, +++ GeneralDistributedMultivariatePolynomial +++ Also See: Polynomial +++ AMS Classifications: +++ Keywords: polynomial, multivariate, distributed +++ References: +++ Description: +++ This type supports distributed multivariate polynomials +++ whose variables are from a user specified list of symbols. +++ The coefficient ring may be non commutative, +++ but the variables are assumed to commute. +++ The term ordering is total degree ordering refined by reverse +++ lexicographic ordering with respect to the position that the variables +++ appear in the list of variables parameter. +HomogeneousDistributedMultivariatePolynomial(vl,R): public == private where + vl : List Symbol + R : Ring + E ==> HomogeneousDirectProduct(#vl,NonNegativeInteger) + OV ==> OrderedVariableList(vl) + public == PolynomialCategory(R,E,OV) with + reorder: (%,List Integer) -> % + ++ reorder(p, perm) applies the permutation perm to the variables + ++ in a polynomial and returns the new correctly ordered polynomial + private == + GeneralDistributedMultivariatePolynomial(vl,R,E) + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain HELLFDIV HyperellipticFiniteDivisor} \pagehead{HyperellipticFiniteDivisor}{HELLFDIV} \pagepic{ps/v103hyperellipticfinitedivisor.ps}{HELLFDIV}{1.00} @@ -25671,6 +27874,298 @@ IndexedBits(mn:Integer): BitAggregate() with @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain IDPAG IndexedDirectProductAbelianGroup} +\pagehead{IndexedDirectProductAbelianGroup}{IDPAG} +\pagepic{ps/v103indexeddirectproductabeliangroup.ps}{IDPAG}{1.00} +See also:\\ +\refto{IndexedDirectProductObject}{IDPO} +\refto{IndexedDirectProductAbelianMonoid}{IDPAM} +\refto{IndexedDirectProductOrderedAbelianMonoid}{IDPOAM} +\refto{IndexedDirectProductOrderedAbelianMonoidSup}{IDPOAMS} +<>= +)abbrev domain IDPAG IndexedDirectProductAbelianGroup +++ Indexed direct products of abelian groups over an abelian group \spad{A} of +++ generators indexed by the ordered set S. +++ All items have finite support: only non-zero terms are stored. +IndexedDirectProductAbelianGroup(A:AbelianGroup,S:OrderedSet): + Join(AbelianGroup,IndexedDirectProductCategory(A,S)) + == IndexedDirectProductAbelianMonoid(A,S) add + --representations + Term:= Record(k:S,c:A) + Rep:= List Term + x,y: % + r: A + n: Integer + f: A -> A + s: S + -x == [[u.k,-u.c] for u in x] + n * x == + n = 0 => 0 + n = 1 => x + [[u.k,a] for u in x | (a:=n*u.c) ^= 0$A] + + qsetrest!: (Rep, Rep) -> Rep + qsetrest!(l: Rep, e: Rep): Rep == RPLACD(l, e)$Lisp + + x - y == + null x => -y + null y => x + endcell: Rep := empty() + res: Rep := empty() + while not empty? x and not empty? y repeat + newcell := empty() + if x.first.k = y.first.k then + r:= x.first.c - y.first.c + if not zero? r then + newcell := cons([x.first.k, r], empty()) + x := rest x + y := rest y + else if x.first.k > y.first.k then + newcell := cons(x.first, empty()) + x := rest x + else + newcell := cons([y.first.k,-y.first.c], empty()) + y := rest y + if not empty? newcell then + if not empty? endcell then + qsetrest!(endcell, newcell) + endcell := newcell + else + res := newcell; + endcell := res + if empty? x then end := - y + else end := x + if empty? res then res := end + else qsetrest!(endcell, end) + res + +-- x - y == +-- empty? x => - y +-- empty? y => x +-- y.first.k > x.first.k => cons([y.first.k,-y.first.c],(x - y.rest)) +-- x.first.k > y.first.k => cons(x.first,(x.rest - y)) +-- r:= x.first.c - y.first.c +-- r = 0 => x.rest - y.rest +-- cons([x.first.k,r],(x.rest - y.rest)) + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain IDPAM IndexedDirectProductAbelianMonoid} +\pagehead{IndexedDirectProductAbelianMonoid}{IDPAM} +\pagepic{ps/v103indexeddirectproductabelianmonoid.ps}{IDPAM}{1.00} +See also:\\ +\refto{IndexedDirectProductObject}{IDPO} +\refto{IndexedDirectProductOrderedAbelianMonoid}{IDPOAM} +\refto{IndexedDirectProductOrderedAbelianMonoidSup}{IDPOAMS} +\refto{IndexedDirectProductAbelianGroup}{IDPAG} +<>= +)abbrev domain IDPAM IndexedDirectProductAbelianMonoid +++ Indexed direct products of abelian monoids over an abelian monoid \spad{A} of +++ generators indexed by the ordered set S. All items have finite support. +++ Only non-zero terms are stored. +IndexedDirectProductAbelianMonoid(A:AbelianMonoid,S:OrderedSet): + Join(AbelianMonoid,IndexedDirectProductCategory(A,S)) + == IndexedDirectProductObject(A,S) add + --representations + Term:= Record(k:S,c:A) + Rep:= List Term + x,y: % + r: A + n: NonNegativeInteger + f: A -> A + s: S + 0 == [] + zero? x == null x + + -- PERFORMANCE CRITICAL; Should build list up + -- by merging 2 sorted lists. Doing this will + -- avoid the recursive calls (very useful if there is a + -- large number of vars in a polynomial. +-- x + y == +-- null x => y +-- null y => x +-- y.first.k > x.first.k => cons(y.first,(x + y.rest)) +-- x.first.k > y.first.k => cons(x.first,(x.rest + y)) +-- r:= x.first.c + y.first.c +-- r = 0 => x.rest + y.rest +-- cons([x.first.k,r],(x.rest + y.rest)) + qsetrest!: (Rep, Rep) -> Rep + qsetrest!(l: Rep, e: Rep): Rep == RPLACD(l, e)$Lisp + + x + y == + null x => y + null y => x + endcell: Rep := empty() + res: Rep := empty() + while not empty? x and not empty? y repeat + newcell := empty() + if x.first.k = y.first.k then + r:= x.first.c + y.first.c + if not zero? r then + newcell := cons([x.first.k, r], empty()) + x := rest x + y := rest y + else if x.first.k > y.first.k then + newcell := cons(x.first, empty()) + x := rest x + else + newcell := cons(y.first, empty()) + y := rest y + if not empty? newcell then + if not empty? endcell then + qsetrest!(endcell, newcell) + endcell := newcell + else + res := newcell; + endcell := res + if empty? x then end := y + else end := x + if empty? res then res := end + else qsetrest!(endcell, end) + res + + n * x == + n = 0 => 0 + n = 1 => x + [[u.k,a] for u in x | (a:=n*u.c) ^= 0$A] + + monomial(r,s) == (r = 0 => 0; [[s,r]]) + map(f,x) == [[tm.k,a] for tm in x | (a:=f(tm.c)) ^= 0$A] + + reductum x == (null x => 0; rest x) + leadingCoefficient x == (null x => 0; x.first.c) + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain IDPO IndexedDirectProductObject} +\pagehead{IndexedDirectProductObject}{IDPO} +\pagepic{ps/v103indexeddirectproductobject.ps}{IDPO}{1.00} +See also:\\ +\refto{IndexedDirectProductAbelianMonoid}{IDPAM} +\refto{IndexedDirectProductOrderedAbelianMonoid}{IDPOAM} +\refto{IndexedDirectProductOrderedAbelianMonoidSup}{IDPOAMS} +\refto{IndexedDirectProductAbelianGroup}{IDPAG} +<>= +)abbrev domain IDPO IndexedDirectProductObject +++ Indexed direct products of objects over a set \spad{A} +++ of generators indexed by an ordered set S. All items have finite support. +IndexedDirectProductObject(A:SetCategory,S:OrderedSet): IndexedDirectProductCategory(A,S) + == add + --representations + Term:= Record(k:S,c:A) + Rep:= List Term + --declarations + x,y: % + f: A -> A + s: S + --define + x = y == + while not null x and _^ null y repeat + x.first.k ^= y.first.k => return false + x.first.c ^= y.first.c => return false + x:=x.rest + y:=y.rest + null x and null y + + coerce(x:%):OutputForm == + bracket [rarrow(t.k :: OutputForm, t.c :: OutputForm) for t in x] + + -- sample():% == [[sample()$S,sample()$A]$Term]$Rep + + monomial(r,s) == [[s,r]] + map(f,x) == [[tm.k,f(tm.c)] for tm in x] + + reductum x == + rest x + leadingCoefficient x == + null x => error "Can't take leadingCoefficient of empty product element" + x.first.c + leadingSupport x == + null x => error "Can't take leadingCoefficient of empty product element" + x.first.k + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain IDPOAM IndexedDirectProductOrderedAbelianMonoid} +\pagehead{IndexedDirectProductOrderedAbelianMonoid}{IDPOAM} +\pagepic{ps/v103indexeddirectproductorderedabelianmonoid.ps}{IDPOAM}{1.00} +See also:\\ +\refto{IndexedDirectProductObject}{IDPO} +\refto{IndexedDirectProductAbelianMonoid}{IDPAM} +\refto{IndexedDirectProductOrderedAbelianMonoidSup}{IDPOAMS} +\refto{IndexedDirectProductAbelianGroup}{IDPAG} +<>= +)abbrev domain IDPOAM IndexedDirectProductOrderedAbelianMonoid +++ Indexed direct products of ordered abelian monoids \spad{A} of +++ generators indexed by the ordered set S. +++ The inherited order is lexicographical. +++ All items have finite support: only non-zero terms are stored. +IndexedDirectProductOrderedAbelianMonoid(A:OrderedAbelianMonoid,S:OrderedSet): + Join(OrderedAbelianMonoid,IndexedDirectProductCategory(A,S)) + == IndexedDirectProductAbelianMonoid(A,S) add + --representations + Term:= Record(k:S,c:A) + Rep:= List Term + x,y: % + x false + empty? x => true -- note careful order of these two lines + y.first.k > x.first.k => true + y.first.k < x.first.k => false + y.first.c > x.first.c => true + y.first.c < x.first.c => false + x.rest < y.rest + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain IDPOAMS IndexedDirectProductOrderedAbelianMonoidSup} +\pagehead{IndexedDirectProductOrderedAbelianMonoidSup}{IDPOAMS} +\pagepic{ps/v103indexeddirectproductorderedabelianmonoidsup.ps}{IDPOAMS}{1.00} +See also:\\ +\refto{IndexedDirectProductObject}{IDPO} +\refto{IndexedDirectProductAbelianMonoid}{IDPAM} +\refto{IndexedDirectProductOrderedAbelianMonoid}{IDPOAM} +\refto{IndexedDirectProductAbelianGroup}{IDPAG} +<>= +)abbrev domain IDPOAMS IndexedDirectProductOrderedAbelianMonoidSup +++ Indexed direct products of ordered abelian monoid sups \spad{A}, +++ generators indexed by the ordered set S. +++ All items have finite support: only non-zero terms are stored. +IndexedDirectProductOrderedAbelianMonoidSup(A:OrderedAbelianMonoidSup,S:OrderedSet): + Join(OrderedAbelianMonoidSup,IndexedDirectProductCategory(A,S)) + == IndexedDirectProductOrderedAbelianMonoid(A,S) add + --representations + Term:= Record(k:S,c:A) + Rep:= List Term + x,y: % + r: A + s: S + + subtractIfCan(x,y) == + empty? y => x + empty? x => "failed" + x.first.k < y.first.k => "failed" + x.first.k > y.first.k => + t:= subtractIfCan(x.rest, y) + t case "failed" => "failed" + cons( x.first, t) + u:=subtractIfCan(x.first.c, y.first.c) + u case "failed" => "failed" + zero? u => subtractIfCan(x.rest, y.rest) + t:= subtractIfCan(x.rest, y.rest) + t case "failed" => "failed" + cons([x.first.k,u],t) + + sup(x,y) == + empty? y => x + empty? x => y + x.first.k < y.first.k => cons(y.first,sup(x,y.rest)) + x.first.k > y.first.k => cons(x.first,sup(x.rest,y)) + u:=sup(x.first.c, y.first.c) + cons([x.first.k,u],sup(x.rest,y.rest)) + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain IFARRAY IndexedFlexibleArray} <>= "IFARRAY" -> "A1AGG" @@ -25925,6 +28420,203 @@ IndexedFlexibleArray(S:Type, mn: Integer): Exports == Implementation where @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain ILIST IndexedList} +\pagehead{IndexedList}{ILIST} +\pagepic{ps/v103indexedlist.ps}{ILIST}{1.00} +See also:\\ +\refto{List}{LIST} +\refto{AssociationList}{ALIST} +<>= +)abbrev domain ILIST IndexedList +++ Author: Michael Monagan +++ Date Created: Sep 1987 +++ Change History: +++ Basic Operations: +++ \#, concat, concat!, construct, copy, elt, elt, empty, +++ empty?, eq?, first, member?, merge!, mergeSort, minIndex, +++ parts, removeDuplicates!, rest, rest, reverse, reverse!, +++ setelt, setfirst!, setrest!, sort!, split! +++ Related Constructors: List +++ Also See: +++ AMS Classification: +++ Keywords: list, aggregate, index +++ Description: +++ \spadtype{IndexedList} is a basic implementation of the functions +++ in \spadtype{ListAggregate}, often using functions in the underlying +++ LISP system. The second parameter to the constructor (\spad{mn}) +++ is the beginning index of the list. That is, if \spad{l} is a +++ list, then \spad{elt(l,mn)} is the first value. This constructor +++ is probably best viewed as the implementation of singly-linked +++ lists that are addressable by index rather than as a mere wrapper +++ for LISP lists. +IndexedList(S:Type, mn:Integer): Exports == Implementation where + cycleMax ==> 1000 -- value used in checking for cycles + +-- The following seems to be a bit out of date, but is kept in case +-- a knowledgeable person wants to update it: +-- The following LISP dependencies are divided into two groups +-- Those that are required +-- CONS, EQ, NIL, NULL, QCAR, QCDR, RPLACA, RPLACD +-- Those that are included for efficiency only +-- NEQ, LIST, CAR, CDR, NCONC2, NREVERSE, LENGTH +-- Also REVERSE, since it's called in Polynomial Ring + + Qfirst ==> QCAR$Lisp + Qrest ==> QCDR$Lisp + Qnull ==> NULL$Lisp + Qeq ==> EQ$Lisp + Qneq ==> NEQ$Lisp + Qcons ==> CONS$Lisp + Qpush ==> PUSH$Lisp + + Exports ==> ListAggregate S + Implementation ==> + add + #x == LENGTH(x)$Lisp + concat(s:S,x:%) == CONS(s,x)$Lisp + eq?(x,y) == EQ(x,y)$Lisp + first x == SPADfirst(x)$Lisp + elt(x,"first") == SPADfirst(x)$Lisp + empty() == NIL$Lisp + empty? x == NULL(x)$Lisp + rest x == CDR(x)$Lisp + elt(x,"rest") == CDR(x)$Lisp + setfirst_!(x,s) == + empty? x => error "Cannot update an empty list" + Qfirst RPLACA(x,s)$Lisp + setelt(x,"first",s) == + empty? x => error "Cannot update an empty list" + Qfirst RPLACA(x,s)$Lisp + setrest_!(x,y) == + empty? x => error "Cannot update an empty list" + Qrest RPLACD(x,y)$Lisp + setelt(x,"rest",y) == + empty? x => error "Cannot update an empty list" + Qrest RPLACD(x,y)$Lisp + construct l == l pretend % + parts s == s pretend List S + reverse_! x == NREVERSE(x)$Lisp + reverse x == REVERSE(x)$Lisp + minIndex x == mn + + rest(x, n) == + for i in 1..n repeat + if Qnull x then error "index out of range" + x := Qrest x + x + + copy x == + y := empty() + for i in 0.. while not Qnull x repeat + if Qeq(i,cycleMax) and cyclic? x then error "cyclic list" + y := Qcons(Qfirst x,y) + x := Qrest x + (NREVERSE(y)$Lisp)@% + + if S has SetCategory then + coerce(x):OutputForm == + -- displays cycle with overbar over the cycle + y := empty()$List(OutputForm) + s := cycleEntry x + while Qneq(x, s) repeat + y := concat((first x)::OutputForm, y) + x := rest x + y := reverse_! y + empty? s => bracket y + -- cyclic case: z is cylic part + z := list((first x)::OutputForm) + while Qneq(s, rest x) repeat + x := rest x + z := concat((first x)::OutputForm, z) + bracket concat_!(y, overbar commaSeparate reverse_! z) + + x = y == + Qeq(x,y) => true + while not Qnull x and not Qnull y repeat + Qfirst x ^=$S Qfirst y => return false + x := Qrest x + y := Qrest y + Qnull x and Qnull y + + latex(x : %): String == + s : String := "\left[" + while not Qnull x repeat + s := concat(s, latex(Qfirst x)$S)$String + x := Qrest x + if not Qnull x then s := concat(s, ", ")$String + concat(s, " \right]")$String + + member?(s,x) == + while not Qnull x repeat + if s = Qfirst x then return true else x := Qrest x + false + + -- Lots of code from parts of AGGCAT, repeated here to + -- get faster compilation + concat_!(x:%,y:%) == + Qnull x => + Qnull y => x + Qpush(first y,x) + QRPLACD(x,rest y)$Lisp + x + z:=x + while not Qnull Qrest z repeat + z:=Qrest z + QRPLACD(z,y)$Lisp + x + + -- Then a quicky: + if S has SetCategory then + removeDuplicates_! l == + p := l + while not Qnull p repeat +-- p := setrest_!(p, remove_!(#1 = Qfirst p, Qrest p)) +-- far too expensive - builds closures etc. + pp:=p + f:S:=Qfirst p + p:=Qrest p + while not Qnull (pr:=Qrest pp) repeat + if (Qfirst pr)@S = f then QRPLACD(pp,Qrest pr)$Lisp + else pp:=pr + l + + -- then sorting + mergeSort: ((S, S) -> Boolean, %, Integer) -> % + + sort_!(f, l) == mergeSort(f, l, #l) + + merge_!(f, p, q) == + Qnull p => q + Qnull q => p + Qeq(p, q) => error "cannot merge a list into itself" + if f(Qfirst p, Qfirst q) + then (r := t := p; p := Qrest p) + else (r := t := q; q := Qrest q) + while not Qnull p and not Qnull q repeat + if f(Qfirst p, Qfirst q) + then (QRPLACD(t, p)$Lisp; t := p; p := Qrest p) + else (QRPLACD(t, q)$Lisp; t := q; q := Qrest q) + QRPLACD(t, if Qnull p then q else p)$Lisp + r + + split_!(p, n) == + n < 1 => error "index out of range" + p := rest(p, (n - 1)::NonNegativeInteger) + q := Qrest p + QRPLACD(p, NIL$Lisp)$Lisp + q + + mergeSort(f, p, n) == + if n = 2 and f(first rest p, first p) then p := reverse_! p + n < 3 => p + l := (n quo 2)::NonNegativeInteger + q := split_!(p, l) + p := mergeSort(f, p, l) + q := mergeSort(f, q, n - l) + merge_!(f, p, q) + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain IARRAY1 IndexedOneDimensionalArray} <>= "IARRAY1" -> "A1AGG" @@ -26065,6 +28757,48 @@ IndexedTwoDimensionalArray(R,mnRow,mnCol):Exports == Implementation where @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain ITUPLE InfiniteTuple} +\pagehead{InfiniteTuple}{ITUPLE} +\pagepic{ps/v103infinitetuple.ps}{ITUPLE}{1.00} +<>= +)abbrev domain ITUPLE InfiniteTuple +++ Infinite tuples for the interpreter +++ Author: Clifton J. Williamson +++ Date Created: 16 February 1990 +++ Date Last Updated: 16 February 1990 +++ Keywords: +++ Examples: +++ References: +InfiniteTuple(S:Type): Exports == Implementation where + ++ This package implements 'infinite tuples' for the interpreter. + ++ The representation is a stream. + + Exports ==> CoercibleTo OutputForm with + map: (S -> S, %) -> % + ++ map(f,t) replaces the tuple t + ++ by \spad{[f(x) for x in t]}. + filterWhile: (S -> Boolean, %) -> % + ++ filterWhile(p,t) returns \spad{[x for x in t while p(x)]}. + filterUntil: (S -> Boolean, %) -> % + ++ filterUntil(p,t) returns \spad{[x for x in t while not p(x)]}. + select: (S -> Boolean, %) -> % + ++ select(p,t) returns \spad{[x for x in t | p(x)]}. + generate: (S -> S,S) -> % + ++ generate(f,s) returns \spad{[s,f(s),f(f(s)),...]}. + construct: % -> Stream S + ++ construct(t) converts an infinite tuple to a stream. + + Implementation ==> Stream S add + generate(f,x) == generate(f,x)$Stream(S) pretend % + filterWhile(f, x) == filterWhile(f,x pretend Stream(S))$Stream(S) pretend % + filterUntil(f, x) == filterUntil(f,x pretend Stream(S))$Stream(S) pretend % + select(f, x) == select(f,x pretend Stream(S))$Stream(S) pretend % + construct x == x pretend Stream(S) +-- coerce x == +-- coerce(x)$Stream(S) + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain IAN InnerAlgebraicNumber} <>= "IAN" -> "ES" @@ -26414,6 +29148,857 @@ InnerIndexedTwoDimensionalArray(R,mnRow,mnCol,Row,Col):_ @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain INT Integer} +The function {\bf one?} has been rewritten back to its original form. +The NAG version called a lisp primitive that exists only in Codemist +Common Lisp and is not defined in Common Lisp. +<>= +-- integer.spad.pamphlet Integer.input +)spool Integer.output +)set message test on +)set message auto off +)clear all +--S 1 of 42 +2**(5678 - 4856 + 2 * 17) +--R +--R +--R (1) +--R 4804810770435008147181540925125924391239526139871682263473855610088084200076_ +--R 308293086342527091412083743074572278211496076276922026433435687527334980249_ +--R 539302425425230458177649495442143929053063884787051467457680738771416988598_ +--R 15495632935288783334250628775936 +--R Type: PositiveInteger +--E 1 + +--S 2 of 42 +x := -101 +--R +--R +--R (2) - 101 +--R Type: Integer +--E 2 + +--S 3 of 42 +abs(x) +--R +--R +--R (3) 101 +--R Type: PositiveInteger +--E 3 + +--S 4 of 42 +sign(x) +--R +--R +--R (4) - 1 +--R Type: Integer +--E 4 + +--S 5 of 42 +x < 0 +--R +--R +--R (5) true +--R Type: Boolean +--E 5 + +--S 6 of 42 +x <= -1 +--R +--R +--R (6) true +--R Type: Boolean +--E 6 + +--S 7 of 42 +negative?(x) +--R +--R +--R (7) true +--R Type: Boolean +--E 7 + +--S 8 of 42 +x > 0 +--R +--R +--R (8) false +--R Type: Boolean +--E 8 + +--S 9 of 42 +x >= 1 +--R +--R +--R (9) false +--R Type: Boolean +--E 9 + +--S 10 of 42 +positive?(x) +--R +--R +--R (10) false +--R Type: Boolean +--E 10 + +--S 11 of 42 +zero?(x) +--R +--R +--R (11) false +--R Type: Boolean +--E 11 + +--S 12 of 42 +one?(x) +--R +--R +--R (12) false +--R Type: Boolean +--E 12 + +--S 13 of 42 +(x = -101)@Boolean +--R +--R +--R (13) true +--R Type: Boolean +--E 13 + +--S 14 of 42 +odd?(x) +--R +--R +--R (14) true +--R Type: Boolean +--E 14 + +--S 15 of 42 +even?(x) +--R +--R +--R (15) false +--R Type: Boolean +--E 15 + +--S 16 of 42 +gcd(56788,43688) +--R +--R +--R (16) 4 +--R Type: PositiveInteger +--E 16 + +--S 17 of 42 +lcm(56788,43688) +--R +--R +--R (17) 620238536 +--R Type: PositiveInteger +--E 17 + +--S 18 of 42 +max(678,567) +--R +--R +--R (18) 678 +--R Type: PositiveInteger +--E 18 + +--S 19 of 42 +min(678,567) +--R +--R +--R (19) 567 +--R Type: PositiveInteger +--E 19 + +--S 20 of 42 +reduce(max,[2,45,-89,78,100,-45]) +--R +--R +--R (20) 100 +--R Type: PositiveInteger +--E 20 + +--S 21 of 42 +reduce(min,[2,45,-89,78,100,-45]) +--R +--R +--R (21) - 89 +--R Type: Integer +--E 21 + +--S 22 of 42 +reduce(gcd,[2,45,-89,78,100,-45]) +--R +--R +--R (22) 1 +--R Type: PositiveInteger +--E 22 + +--S 23 of 42 +reduce(lcm,[2,45,-89,78,100,-45]) +--R +--R +--R (23) 1041300 +--R Type: PositiveInteger +--E 23 + +--S 24 of 42 +13 / 4 +--R +--R +--R 13 +--R (24) -- +--R 4 +--R Type: Fraction Integer +--E 24 + +--S 25 of 42 +13 quo 4 +--R +--R +--R (25) 3 +--R Type: PositiveInteger +--E 25 + +--S 26 of 42 +13 rem 4 +--R +--R +--R (26) 1 +--R Type: PositiveInteger +--E 26 + +--S 27 of 42 +zero?(167604736446952 rem 2003644) +--R +--R +--R (27) true +--R Type: Boolean +--E 27 + +--S 28 of 42 +d := divide(13,4) +--R +--R +--R (28) [quotient= 3,remainder= 1] +--R Type: Record(quotient: Integer,remainder: Integer) +--E 28 + +--S 29 of 42 +d.quotient +--R +--R +--R (29) 3 +--R Type: PositiveInteger +--E 29 + +--S 30 of 42 +d.remainder +--R +--R +--R (30) 1 +--R Type: PositiveInteger +--E 30 + +--S 31 of 42 +factor 102400 +--R +--R +--R 12 2 +--R (31) 2 5 +--R Type: Factored Integer +--E 31 + +--S 32 of 42 +prime? 7 +--R +--R +--R (32) true +--R Type: Boolean +--E 32 + +--S 33 of 42 +prime? 8 +--R +--R +--R (33) false +--R Type: Boolean +--E 33 + +--S 34 of 42 +nextPrime 100 +--R +--R +--R (34) 101 +--R Type: PositiveInteger +--E 34 + +--S 35 of 42 +prevPrime 100 +--R +--R +--R (35) 97 +--R Type: PositiveInteger +--E 35 + +--S 36 of 42 +primes(100,175) +--R +--R +--R (36) [173,167,163,157,151,149,139,137,131,127,113,109,107,103,101] +--R Type: List Integer +--E 36 + +--S 37 of 42 +factor(2 :: Complex Integer) +--R +--R +--R 2 +--R (37) - %i (1 + %i) +--R Type: Factored Complex Integer +--E 37 + +--S 38 of 42 +[fibonacci(k) for k in 0..] +--R +--R +--R (38) [0,1,1,2,3,5,8,13,21,34,...] +--R Type: Stream Integer +--E 38 + +--S 39 of 42 +[legendre(i,11) for i in 0..10] +--R +--R +--R (39) [0,1,- 1,1,1,1,- 1,- 1,- 1,1,- 1] +--R Type: List Integer +--E 39 + +--S 40 of 42 +[jacobi(i,15) for i in 0..9] +--R +--R +--R (40) [0,1,1,0,1,0,0,- 1,1,0] +--R Type: List Integer +--E 40 + +--S 41 of 42 +[eulerPhi i for i in 1..] +--R +--R +--R (41) [1,1,2,2,4,2,6,4,6,4,...] +--R Type: Stream Integer +--E 41 + +--S 42 of 42 +[moebiusMu i for i in 1..] +--R +--R +--R (42) [1,- 1,- 1,0,- 1,1,- 1,0,0,1,...] +--R Type: Stream Integer +--E 42 +)spool +)lisp (bye) +@ +<>= +==================================================================== +Integer examples +==================================================================== + +Axiom provides many operations for manipulating arbitrary precision +integers. In this section we will show some of those that come from +Integer itself plus some that are implemented in other packages. + +\subsection{Basic Functions} + +The size of an integer in Axiom is only limited by the amount of +computer storage you have available. The usual arithmetic operations +are available. + + 2**(5678 - 4856 + 2 * 17) + 4804810770435008147181540925125924391239526139871682263473855610088084200076_ + 308293086342527091412083743074572278211496076276922026433435687527334980249_ + 539302425425230458177649495442143929053063884787051467457680738771416988598_ + 15495632935288783334250628775936 + Type: PositiveInteger + +There are a number of ways of working with the sign of an integer. +Let's use this x as an example. + + x := -101 + - 101 + Type: Integer + +First of all, there is the absolute value function. + + abs(x) + 101 + Type: PositiveInteger + +The sign operation returns -1 if its argument is negative, 0 if zero +and 1 if positive. + + sign(x) + - 1 + Type: Integer + +You can determine if an integer is negative in several other ways. + + x < 0 + true + Type: Boolean + + x <= -1 + true + Type: Boolean + + negative?(x) + true + Type: Boolean + +Similarly, you can find out if it is positive. + + x > 0 + false + Type: Boolean + + x >= 1 + false + Type: Boolean + + positive?(x) + false + Type: Boolean + +This is the recommended way of determining whether an integer is zero. + + zero?(x) + false + Type: Boolean + +Use the zero? operation whenever you are testing any mathematical +object for equality with zero. This is usually more efficient that +using = (think of matrices: it is easier to tell if a matrix is zero +by just checking term by term than constructing another "zero" matrix +and comparing the two matrices term by term) and also avoids the +problem that = is usually used for creating equations. + +This is the recommended way of determining whether an integer is equal +to one. + + one?(x) + false + Type: Boolean + +This syntax is used to test equality using =. It says that you want a +Boolean (true or false) answer rather than an equation. + + (x = -101)@Boolean + true + Type: Boolean + +The operations odd? and even? determine whether an integer is odd or +even, respectively. They each return a Boolean object. + + odd?(x) + true + Type: Boolean + + even?(x) + false + Type: Boolean + +The operation gcd computes the greatest common divisor of two integers. + + gcd(56788,43688) + 4 + Type: PositiveInteger + +The operation lcm computes their least common multiple. + + lcm(56788,43688) + 620238536 + Type: PositiveInteger + +To determine the maximum of two integers, use max. + + max(678,567) + 678 + Type: PositiveInteger + +To determine the minimum, use min. + + min(678,567) + 567 + Type: PositiveInteger + +The reduce operation is used to extend binary operations to more +than two arguments. For example, you can use reduce to find the +maximum integer in a list or compute the least common multiple of all +integers in the list. + + reduce(max,[2,45,-89,78,100,-45]) + 100 + Type: PositiveInteger + + reduce(min,[2,45,-89,78,100,-45]) + - 89 + Type: Integer + + reduce(gcd,[2,45,-89,78,100,-45]) + 1 + Type: PositiveInteger + + reduce(lcm,[2,45,-89,78,100,-45]) + 1041300 + Type: PositiveInteger + +The infix operator "/" is not used to compute the quotient of integers. +Rather, it is used to create rational numbers as described in Fraction. + + 13 / 4 + 13 + -- + 4 + Type: Fraction Integer + +The infix operation quo computes the integer quotient. + + 13 quo 4 + 3 + Type: PositiveInteger + +The infix operation rem computes the integer remainder. + + 13 rem 4 + 1 + Type: PositiveInteger + +One integer is evenly divisible by another if the remainder is zero. +The operation exquo can also be used. + + zero?(167604736446952 rem 2003644) + true + Type: Boolean + +The operation divide returns a record of the quotient and remainder +and thus is more efficient when both are needed. + + d := divide(13,4) + [quotient= 3,remainder= 1] + Type: Record(quotient: Integer,remainder: Integer) + + d.quotient + 3 + Type: PositiveInteger + +See help on Records for details on Records. + + d.remainder + 1 + Type: PositiveInteger + +==================================================================== +Primes and Factorization +==================================================================== + +Use the operation factor to factor integers. It returns an object of +type Factored Integer. + + factor 102400 + 12 2 + 2 5 + Type: Factored Integer + +The operation prime? returns true or false depending on whether its +argument is a prime. + + prime? 7 + true + Type: Boolean + + prime? 8 + false + Type: Boolean + +The operation nextPrime returns the least prime number greater than +its argument. + + nextPrime 100 + 101 + Type: PositiveInteger + +The operation prevPrime returns the greatest prime number less than +its argument. + + prevPrime 100 + 97 + Type: PositiveInteger + +To compute all primes between two integers (inclusively), use the +operation primes. + + primes(100,175) + [173,167,163,157,151,149,139,137,131,127,113,109,107,103,101] + Type: List Integer + +You might sometimes want to see the factorization of an integer +when it is considered a Gaussian integer. + + factor(2 :: Complex Integer) + 2 + - %i (1 + %i) + Type: Factored Complex Integer + +==================================================================== +Some Number Theoretic Functions +==================================================================== + +Axiom provides several number theoretic operations for integers. + +The operation fibonacci computes the Fibonacci numbers. The algorithm +has running time O(log^3n) for argument n. + + [fibonacci(k) for k in 0..] + [0,1,1,2,3,5,8,13,21,34,...] + Type: Stream Integer + +The operation legendre computes the Legendre symbol for its two integer +arguments where the second one is prime. If you know the second argument +to be prime, use jacobi instead where no check is made. + + [legendre(i,11) for i in 0..10] + [0,1,- 1,1,1,1,- 1,- 1,- 1,1,- 1] + Type: List Integer + +The operation jacobi computes the Jacobi symbol for its two integer +arguments. By convention, 0 is returned if the greatest common divisor +of the numerator and denominator is not 1. + + [jacobi(i,15) for i in 0..9] + [0,1,1,0,1,0,0,- 1,1,0] + Type: List Integer + +The operation eulerPhi computes the values of Euler's \phi-function +where \phi(n) equals the number of positive integers less than or equal +to n that are relatively prime to the positive integer n. + + [eulerPhi i for i in 1..] + [1,1,2,2,4,2,6,4,6,4,...] + Type: Stream Integer + +The operation moebiusMu computes the Moebius mu function. + + [moebiusMu i for i in 1..] + [1,- 1,- 1,0,- 1,1,- 1,0,0,1,...] + Type: Stream Integer + + +See Also: +o )help Complex +o )help Factored +o )help Records +o )help Fraction +o )help RadixExpansion +o )help HexadecimalExpansion +o )help BinaryExpansion +o )help DecimalExpansion +o )help IntegerNumberTheoryFunctions +o )help RomanNumeral +o )show Integer +o $AXIOM/doc/src/algebra/integer.spad.dvi + +@ +\pagehead{Integer}{INT} +\pagepic{ps/v103integer.ps}{INT}{1.00} +See also:\\ +\refto{NonNegativeInteger}{NNI} +\refto{PositiveInteger}{PI} +\refto{RomanNumeral}{ROMAN} +<>= +)abbrev domain INT Integer +++ Author: +++ Date Created: +++ Change History: +++ Basic Operations: +++ Related Constructors: +++ Keywords: integer +++ Description: \spadtype{Integer} provides the domain of arbitrary precision +++ integers. + +Integer: Join(IntegerNumberSystem, ConvertibleTo String, OpenMath) with + random : % -> % + ++ random(n) returns a random integer from 0 to \spad{n-1}. + canonical + ++ mathematical equality is data structure equality. + canonicalsClosed + ++ two positives multiply to give positive. + noetherian + ++ ascending chain condition on ideals. + infinite + ++ nextItem never returns "failed". + == add + ZP ==> SparseUnivariatePolynomial % + ZZP ==> SparseUnivariatePolynomial Integer + x,y: % + n: NonNegativeInteger + + writeOMInt(dev: OpenMathDevice, x: %): Void == + if x < 0 then + OMputApp(dev) + OMputSymbol(dev, "arith1", "unary__minus") + OMputInteger(dev, (-x) pretend Integer) + OMputEndApp(dev) + else + OMputInteger(dev, x pretend Integer) + + OMwrite(x: %): String == + s: String := "" + sp := OM_-STRINGTOSTRINGPTR(s)$Lisp + dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML) + OMputObject(dev) + writeOMInt(dev, x) + OMputEndObject(dev) + OMclose(dev) + s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String + s + + OMwrite(x: %, wholeObj: Boolean): String == + s: String := "" + sp := OM_-STRINGTOSTRINGPTR(s)$Lisp + dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML) + if wholeObj then + OMputObject(dev) + writeOMInt(dev, x) + if wholeObj then + OMputEndObject(dev) + OMclose(dev) + s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String + s + + OMwrite(dev: OpenMathDevice, x: %): Void == + OMputObject(dev) + writeOMInt(dev, x) + OMputEndObject(dev) + + OMwrite(dev: OpenMathDevice, x: %, wholeObj: Boolean): Void == + if wholeObj then + OMputObject(dev) + writeOMInt(dev, x) + if wholeObj then + OMputEndObject(dev) + + zero? x == ZEROP(x)$Lisp +-- one? x == ONEP(x)$Lisp + one? x == x = 1 + 0 == 0$Lisp + 1 == 1$Lisp + base() == 2$Lisp + copy x == x + inc x == x + 1 + dec x == x - 1 + hash x == SXHASH(x)$Lisp + negative? x == MINUSP(x)$Lisp + coerce(x):OutputForm == outputForm(x pretend Integer) + coerce(m:Integer):% == m pretend % + convert(x:%):Integer == x pretend Integer + length a == INTEGER_-LENGTH(a)$Lisp + addmod(a, b, p) == + (c:=a + b) >= p => c - p + c + submod(a, b, p) == + (c:=a - b) < 0 => c + p + c + mulmod(a, b, p) == (a * b) rem p + convert(x:%):Float == coerce(x pretend Integer)$Float + convert(x:%):DoubleFloat == coerce(x pretend Integer)$DoubleFloat + convert(x:%):InputForm == convert(x pretend Integer)$InputForm + convert(x:%):String == string(x pretend Integer)$String + + latex(x:%):String == + s : String := string(x pretend Integer)$String + (-1 < (x pretend Integer)) and ((x pretend Integer) < 10) => s + concat("{", concat(s, "}")$String)$String + + positiveRemainder(a, b) == + negative?(r := a rem b) => + negative? b => r - b + r + b + r + + reducedSystem(m:Matrix %):Matrix(Integer) == + m pretend Matrix(Integer) + + reducedSystem(m:Matrix %, v:Vector %): + Record(mat:Matrix(Integer), vec:Vector(Integer)) == + [m pretend Matrix(Integer), vec pretend Vector(Integer)] + + abs(x) == ABS(x)$Lisp + random() == random()$Lisp + random(x) == RANDOM(x)$Lisp + x = y == EQL(x,y)$Lisp + x < y == (x "failed" + zero?(x rem y) => x quo y + "failed" +-- recip(x) == if one? x or x=-1 then x else "failed" + recip(x) == if (x = 1) or x=-1 then x else "failed" + gcd(x,y) == GCD(x,y)$Lisp + UCA ==> Record(unit:%,canonical:%,associate:%) + unitNormal x == + x < 0 => [-1,-x,-1]$UCA + [1,x,1]$UCA + unitCanonical x == abs x + solveLinearPolynomialEquation(lp:List ZP,p:ZP):Union(List ZP,"failed") == + solveLinearPolynomialEquation(lp pretend List ZZP, + p pretend ZZP)$IntegerSolveLinearPolynomialEquation pretend + Union(List ZP,"failed") + squareFreePolynomial(p:ZP):Factored ZP == + squareFree(p)$UnivariatePolynomialSquareFree(%,ZP) + factorPolynomial(p:ZP):Factored ZP == + -- GaloisGroupFactorizer doesn't factor the content + -- so we have to do this by hand + pp:=primitivePart p + leadingCoefficient pp = leadingCoefficient p => + factor(p)$GaloisGroupFactorizer(ZP) + mergeFactors(factor(pp)$GaloisGroupFactorizer(ZP), + map(#1::ZP, + factor((leadingCoefficient p exquo + leadingCoefficient pp) + ::%))$FactoredFunctions2(%,ZP) + )$FactoredFunctionUtilities(ZP) + factorSquareFreePolynomial(p:ZP):Factored ZP == + factorSquareFree(p)$GaloisGroupFactorizer(ZP) + gcdPolynomial(p:ZP, q:ZP):ZP == + zero? p => unitCanonical q + zero? q => unitCanonical p + gcd([p,q])$HeuGcd(ZP) +-- myNextPrime: (%,NonNegativeInteger) -> % +-- myNextPrime(x,n) == +-- nextPrime(x)$IntegerPrimesPackage(%) +-- TT:=InnerModularGcd(%,ZP,67108859 pretend %,myNextPrime) +-- gcdPolynomial(p,q) == modularGcd(p,q)$TT + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain ZMOD IntegerMod} \pagehead{IntegerMod}{ZMOD} \pagepic{ps/v103integermod.ps}{ZMOD}{1.00} @@ -26608,11 +30193,1091 @@ IntegrationFunctionsTable(): E == I where @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain IR IntegrationResult} +\pagehead{IntegrationResult}{IR} +\pagepic{ps/v103integrationresult.ps}{IR}{1.00} +<>= +)abbrev domain IR IntegrationResult +++ The result of a transcendental integration. +++ Author: Barry Trager, Manuel Bronstein +++ Date Created: 1987 +++ Date Last Updated: 12 August 1992 +++ Description: +++ If a function f has an elementary integral g, then g can be written +++ in the form \spad{g = h + c1 log(u1) + c2 log(u2) + ... + cn log(un)} +++ where h, which is in the same field than f, is called the rational +++ part of the integral, and \spad{c1 log(u1) + ... cn log(un)} is called the +++ logarithmic part of the integral. This domain manipulates integrals +++ represented in that form, by keeping both parts separately. The logs +++ are not explicitly computed. +++ Keywords: integration. +++ Examples: )r RATINT INPUT +IntegrationResult(F:Field): Exports == Implementation where + O ==> OutputForm + B ==> Boolean + Z ==> Integer + Q ==> Fraction Integer + SE ==> Symbol + UP ==> SparseUnivariatePolynomial F + LOG ==> Record(scalar:Q, coeff:UP, logand:UP) + NE ==> Record(integrand:F, intvar:F) + + Exports ==> (Module Q, RetractableTo F) with + mkAnswer: (F, List LOG, List NE) -> % + ++ mkAnswer(r,l,ne) creates an integration result from + ++ a rational part r, a logarithmic part l, and a non-elementary part ne. + ratpart : % -> F + ++ ratpart(ir) returns the rational part of an integration result + logpart : % -> List LOG + ++ logpart(ir) returns the logarithmic part of an integration result + notelem : % -> List NE + ++ notelem(ir) returns the non-elementary part of an integration result + elem? : % -> B + ++ elem?(ir) tests if an integration result is elementary over F? + integral: (F, F) -> % + ++ integral(f,x) returns the formal integral of f with respect to x + differentiate: (%, F -> F) -> F + ++ differentiate(ir,D) differentiates ir with respect to the derivation D. + if F has PartialDifferentialRing(SE) then + differentiate: (%, Symbol) -> F + ++ differentiate(ir,x) differentiates ir with respect to x + if F has RetractableTo Symbol then + integral: (F, Symbol) -> % + ++ integral(f,x) returns the formal integral of f with respect to x + + Implementation ==> add + Rep := Record(ratp: F, logp: List LOG, nelem: List NE) + + timelog : (Q, LOG) -> LOG + timene : (Q, NE) -> NE + LOG2O : LOG -> O + NE2O : NE -> O + Q2F : Q -> F + nesimp : List NE -> List NE + neselect: (List NE, F) -> F + pLogDeriv: (LOG, F -> F) -> F + pNeDeriv : (NE, F -> F) -> F + + + alpha:O := new()$Symbol :: O + + - u == (-1$Z) * u + 0 == mkAnswer(0, empty(), empty()) + coerce(x:F):% == mkAnswer(x, empty(), empty()) + ratpart u == u.ratp + logpart u == u.logp + notelem u == u.nelem + elem? u == empty? notelem u + mkAnswer(x, l, n) == [x, l, nesimp n] + timelog(r, lg) == [r * lg.scalar, lg.coeff, lg.logand] + integral(f:F,x:F) == (zero? f => 0; mkAnswer(0, empty(), [[f, x]])) + timene(r, ne) == [Q2F(r) * ne.integrand, ne.intvar] + n:Z * u:% == (n::Q) * u + Q2F r == numer(r)::F / denom(r)::F + neselect(l, x) == _+/[ne.integrand for ne in l | ne.intvar = x] + + if F has RetractableTo Symbol then + integral(f:F, x:Symbol):% == integral(f, x::F) + + LOG2O rec == +-- one? degree rec.coeff => + (degree rec.coeff) = 1 => + -- deg 1 minimal poly doesn't get sigma + lastc := - coefficient(rec.coeff, 0) / coefficient(rec.coeff, 1) + lg := (rec.logand) lastc + logandp := prefix("log"::Symbol::O, [lg::O]) + (cc := Q2F(rec.scalar) * lastc) = 1 => logandp + cc = -1 => - logandp + cc::O * logandp + coeffp:O := (outputForm(rec.coeff, alpha) = 0::Z::O)@O + logandp := + alpha * prefix("log"::Symbol::O, [outputForm(rec.logand, alpha)]) + if (cc := Q2F(rec.scalar)) ^= 1 then + logandp := cc::O * logandp + sum(logandp, coeffp) + + nesimp l == + [[u,x] for x in removeDuplicates_!([ne.intvar for ne in l]$List(F)) + | (u := neselect(l, x)) ^= 0] + + if (F has LiouvillianFunctionCategory) and (F has RetractableTo Symbol) then + retractIfCan u == + empty? logpart u => + ratpart u + + _+/[integral(ne.integrand, retract(ne.intvar)@Symbol)$F + for ne in notelem u] + "failed" + + else + retractIfCan u == + elem? u and empty? logpart u => ratpart u + "failed" + + r:Q * u:% == + r = 0 => 0 + mkAnswer(Q2F(r) * ratpart u, map(timelog(r, #1), logpart u), + map(timene(r, #1), notelem u)) + + -- Initial attempt, quick and dirty, no simplification + u + v == + mkAnswer(ratpart u + ratpart v, concat(logpart u, logpart v), + nesimp concat(notelem u, notelem v)) + + if F has PartialDifferentialRing(Symbol) then + differentiate(u:%, x:Symbol):F == differentiate(u, differentiate(#1, x)) + + differentiate(u:%, derivation:F -> F):F == + derivation ratpart u + + _+/[pLogDeriv(log, derivation) for log in logpart u] + + _+/[pNeDeriv(ne, derivation) for ne in notelem u] + + pNeDeriv(ne, derivation) == +-- one? derivation(ne.intvar) => ne.integrand + (derivation(ne.intvar) = 1) => ne.integrand + zero? derivation(ne.integrand) => 0 + error "pNeDeriv: cannot differentiate not elementary part into F" + + pLogDeriv(log, derivation) == + map(derivation, log.coeff) ^= 0 => + error "pLogDeriv: can only handle logs with constant coefficients" +-- one?(n := degree(log.coeff)) => + ((n := degree(log.coeff)) = 1) => + c := - (leadingCoefficient reductum log.coeff) + / (leadingCoefficient log.coeff) + ans := (log.logand) c + Q2F(log.scalar) * c * derivation(ans) / ans + numlog := map(derivation, log.logand) + diflog := extendedEuclidean(log.logand, log.coeff, + numlog)::Record(coef1:UP, coef2:UP) + algans := diflog.coef1 + ans:F := 0 + for i in 0..(n-1) repeat + algans := algans * monomial(1, 1) rem log.coeff + ans := ans + coefficient(algans, i) + Q2F(log.scalar) * ans + + coerce(u:%):O == + (r := retractIfCan u) case F => r::F::O + l := reverse_! [LOG2O f for f in logpart u]$List(O) + if ratpart u ^= 0 then l := concat(ratpart(u)::O, l) + if not elem? u then l := concat([NE2O f for f in notelem u], l) + null l => 0::O + reduce("+", l) + + NE2O ne == + int((ne.integrand)::O * hconcat ["d"::Symbol::O, (ne.intvar)::O]) + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain INTRVL Interval} +\pagehead{Interval}{INTRVL} +\pagepic{ps/v103interval.ps}{INTRVL}{1.00} +<>= +)abbrev domain INTRVL Interval ++++ Author: Mike Dewar ++++ Date Created: November 1996 ++++ Date Last Updated: ++++ Basic Functions: ++++ Related Constructors: ++++ Also See: ++++ AMS Classifications: ++++ Keywords: ++++ References: ++++ Description: ++++ This domain is an implementation of interval arithmetic and transcendental ++++ functions over intervals. +Interval(R:Join(FloatingPointSystem,TranscendentalFunctionCategory)): IntervalCategory(R) == add + + import Integer +-- import from R + + Rep := Record(Inf:R, Sup:R) + + roundDown(u:R):R == + if zero?(u) then float(-1,-(bits() pretend Integer)) + else float(mantissa(u) - 1,exponent(u)) + + roundUp(u:R):R == + if zero?(u) then float(1, -(bits()) pretend Integer) + else float(mantissa(u) + 1,exponent(u)) + + -- Sometimes the float representation does not use all the bits (e.g. when + -- representing an integer in software using arbitrary-length Integers as + -- your mantissa it is convenient to keep them exact). This function + -- normalises things so that rounding etc. works as expected. It is only + -- called when creating new intervals. + normaliseFloat(u:R):R == + zero? u => u + m : Integer := mantissa u + b : Integer := bits() pretend Integer + l : Integer := length(m) + if l < b then + BASE : Integer := base()$R pretend Integer + float(m*BASE**((b-l) pretend PositiveInteger),exponent(u)-b+l) + else + u + + interval(i:R,s:R):% == + i > s => [roundDown normaliseFloat s,roundUp normaliseFloat i] + [roundDown normaliseFloat i,roundUp normaliseFloat s] + + interval(f:R):% == + zero?(f) => 0 + one?(f) => 1 + -- This next part is necessary to allow e.g. mapping between Expressions: + -- AXIOM assumes that Integers stay as Integers! +-- import from Union(value1:Integer,failed:"failed") + fnew : R := normaliseFloat f + retractIfCan(f)@Union(Integer,"failed") case "failed" => + [roundDown fnew, roundUp fnew] + [fnew,fnew] + + qinterval(i:R,s:R):% == + [roundDown normaliseFloat i,roundUp normaliseFloat s] + + exactInterval(i:R,s:R):% == [i,s] + exactSupInterval(i:R,s:R):% == [roundDown i,s] + exactInfInterval(i:R,s:R):% == [i,roundUp s] + + inf(u:%):R == u.Inf + sup(u:%):R == u.Sup + width(u:%):R == u.Sup - u.Inf + + contains?(u:%,f:R):Boolean == (f > inf(u)) and (f < sup(u)) + + positive?(u:%):Boolean == inf(u) > 0 + negative?(u:%):Boolean == sup(u) < 0 + + _< (a:%,b:%):Boolean == + if inf(a) < inf(b) then + true + else if inf(a) > inf(b) then + false + else + sup(a) < sup(b) + + _+ (a:%,b:%):% == + -- A couple of blatent hacks to preserve the Ring Axioms! + if zero?(a) then return(b) else if zero?(b) then return(a) + if a = b then return qinterval(2*inf(a),2*sup(a)) + qinterval(inf(a) + inf(b), sup(a) + sup(b)) + + + _- (a:%,b:%):% == + if zero?(a) then return(-b) else if zero?(b) then return(a) + if a = b then 0 else qinterval(inf(a) - sup(b), sup(a) - inf(b)) + + + _* (a:%,b:%):% == + -- A couple of blatent hacks to preserve the Ring Axioms! + if one?(a) then return(b) else if one?(b) then return(a) + if zero?(a) then return(0) else if zero?(b) then return(0) + prods : List R := sort [inf(a)*inf(b),sup(a)*sup(b), + inf(a)*sup(b),sup(a)*inf(b)] + qinterval(first prods, last prods) + + + _* (a:Integer,b:%):% == + if (a > 0) then + qinterval(a*inf(b),a*sup(b)) + else if (a < 0) then + qinterval(a*sup(b),a*inf(b)) + else + 0 + + _* (a:PositiveInteger,b:%):% == qinterval(a*inf(b),a*sup(b)) + + _*_* (a:%,n:PositiveInteger):% == + contains?(a,0) and zero?((n pretend Integer) rem 2) => + interval(0,max(inf(a)**n,sup(a)**n)) + interval(inf(a)**n,sup(a)**n) + + + _^ (a:%,n:PositiveInteger):% == + contains?(a,0) and zero?((n pretend Integer) rem 2) => + interval(0,max(inf(a)**n,sup(a)**n)) + interval(inf(a)**n,sup(a)**n) + + _- (a:%):% == exactInterval(-sup(a),-inf(a)) + + _= (a:%,b:%):Boolean == (inf(a)=inf(b)) and (sup(a)=sup(b)) + _~_= (a:%,b:%):Boolean == (inf(a)~=inf(b)) or (sup(a)~=sup(b)) + + 1 == + one : R := normaliseFloat 1 + [one,one] + + 0 == [0,0] + + recip(u:%):Union(%,"failed") == + contains?(u,0) => "failed" + vals:List R := sort [1/inf(u),1/sup(u)]$List(R) + qinterval(first vals, last vals) + + + unit?(u:%):Boolean == contains?(u,0) + + _exquo(u:%,v:%):Union(%,"failed") == + contains?(v,0) => "failed" + one?(v) => u + u=v => 1 + u=-v => -1 + vals:List R := sort [inf(u)/inf(v),inf(u)/sup(v),sup(u)/inf(v),sup(u)/sup(v)]$List(R) + qinterval(first vals, last vals) + + + gcd(u:%,v:%):% == 1 + + coerce(u:Integer):% == + ur := normaliseFloat(u::R) + exactInterval(ur,ur) + + + interval(u:Fraction Integer):% == +-- import log2 : % -> % +-- coerce : Integer -> % +-- retractIfCan : % -> Union(value1:Integer,failed:"failed") +-- from Float + flt := u::R + + -- Test if the representation in R is exact + --den := denom(u)::Float + bin : Union(Integer,"failed") := retractIfCan(log2(denom(u)::Float)) + bin case Integer and length(numer u)$Integer < (bits() pretend Integer) => + flt := normaliseFloat flt + exactInterval(flt,flt) + + qinterval(flt,flt) + + + retractIfCan(u:%):Union(Integer,"failed") == + not zero? width(u) => "failed" + retractIfCan inf u + + + retract(u:%):Integer == + not zero? width(u) => + error "attempt to retract a non-Integer interval to an Integer" + retract inf u + + + coerce(u:%):OutputForm == + bracket([coerce inf(u), coerce sup(u)]$List(OutputForm)) + + characteristic():NonNegativeInteger == 0 + + + -- Explicit export from TranscendentalFunctionCategory + pi():% == qinterval(pi(),pi()) + + -- From ElementaryFunctionCategory + log(u:%):% == + positive?(u) => qinterval(log inf u, log sup u) + error "negative logs in interval" + + + exp(u:%):% == qinterval(exp inf u, exp sup u) + + _*_* (u:%,v:%):% == + zero?(v) => if zero?(u) then error "0**0 is undefined" else 1 + one?(u) => 1 + expts : List R := sort [inf(u)**inf(v),sup(u)**sup(v), + inf(u)**sup(v),sup(u)**inf(v)] + qinterval(first expts, last expts) + + -- From TrigonometricFunctionCategory + + -- This function checks whether an interval contains a value of the form + -- `offset + 2 n pi'. + hasTwoPiMultiple(offset:R,ipi:R,i:%):Boolean == + next : Integer := retract ceiling( (inf(i) - offset)/(2*ipi) ) + contains?(i,offset+2*next*ipi) + + + -- This function checks whether an interval contains a value of the form + -- `offset + n pi'. + hasPiMultiple(offset:R,ipi:R,i:%):Boolean == + next : Integer := retract ceiling( (inf(i) - offset)/ipi ) + contains?(i,offset+next*ipi) + + + sin(u:%):% == + ipi : R := pi()$R + hasOne? : Boolean := hasTwoPiMultiple(ipi/(2::R),ipi,u) + hasMinusOne? : Boolean := hasTwoPiMultiple(3*ipi/(2::R),ipi,u) + + if hasOne? and hasMinusOne? then + exactInterval(-1,1) + else + vals : List R := sort [sin inf u, sin sup u] + if hasOne? then + exactSupInterval(first vals, 1) + else if hasMinusOne? then + exactInfInterval(-1,last vals) + else + qinterval(first vals, last vals) + + + + cos(u:%):% == + ipi : R := pi() + hasOne? : Boolean := hasTwoPiMultiple(0,ipi,u) + hasMinusOne? : Boolean := hasTwoPiMultiple(ipi,ipi,u) + + if hasOne? and hasMinusOne? then + exactInterval(-1,1) + else + vals : List R := sort [cos inf u, cos sup u] + if hasOne? then + exactSupInterval(first vals, 1) + else if hasMinusOne? then + exactInfInterval(-1,last vals) + else + qinterval(first vals, last vals) + + + + tan(u:%):% == + ipi : R := pi() + if width(u) > ipi then + error "Interval contains a singularity" + else + -- Since we know the interval is less than pi wide, monotonicity implies + -- that there is no singularity. If there is a singularity on a endpoint + -- of the interval the user will see the error generated by R. + lo : R := tan inf u + hi : R := tan sup u + + lo > hi => error "Interval contains a singularity" + qinterval(lo,hi) + + + + csc(u:%):% == + ipi : R := pi() + if width(u) > ipi then + error "Interval contains a singularity" + else +-- import from Integer + -- singularities are at multiples of Pi + if hasPiMultiple(0,ipi,u) then error "Interval contains a singularity" + vals : List R := sort [csc inf u, csc sup u] + if hasTwoPiMultiple(ipi/(2::R),ipi,u) then + exactInfInterval(1,last vals) + else if hasTwoPiMultiple(3*ipi/(2::R),ipi,u) then + exactSupInterval(first vals,-1) + else + qinterval(first vals, last vals) + + + + sec(u:%):% == + ipi : R := pi() + if width(u) > ipi then + error "Interval contains a singularity" + else +-- import from Integer + -- singularities are at Pi/2 + n Pi + if hasPiMultiple(ipi/(2::R),ipi,u) then + error "Interval contains a singularity" + vals : List R := sort [sec inf u, sec sup u] + if hasTwoPiMultiple(0,ipi,u) then + exactInfInterval(1,last vals) + else if hasTwoPiMultiple(ipi,ipi,u) then + exactSupInterval(first vals,-1) + else + qinterval(first vals, last vals) + + + + + cot(u:%):% == + ipi : R := pi() + if width(u) > ipi then + error "Interval contains a singularity" + else + -- Since we know the interval is less than pi wide, monotonicity implies + -- that there is no singularity. If there is a singularity on a endpoint + -- of the interval the user will see the error generated by R. + hi : R := cot inf u + lo : R := cot sup u + + lo > hi => error "Interval contains a singularity" + qinterval(lo,hi) + + + + -- From ArcTrigonometricFunctionCategory + + asin(u:%):% == + lo : R := inf(u) + hi : R := sup(u) + if (lo < -1) or (hi > 1) then error "asin only defined on the region -1..1" + qinterval(asin lo,asin hi) + + + acos(u:%):% == + lo : R := inf(u) + hi : R := sup(u) + if (lo < -1) or (hi > 1) then error "acos only defined on the region -1..1" + qinterval(acos hi,acos lo) + + + atan(u:%):% == qinterval(atan inf u, atan sup u) + + acot(u:%):% == qinterval(acot sup u, acot inf u) + + acsc(u:%):% == + lo : R := inf(u) + hi : R := sup(u) + if ((lo <= -1) and (hi >= -1)) or ((lo <= 1) and (hi >= 1)) then + error "acsc not defined on the region -1..1" + qinterval(acsc hi, acsc lo) + + + asec(u:%):% == + lo : R := inf(u) + hi : R := sup(u) + if ((lo < -1) and (hi > -1)) or ((lo < 1) and (hi > 1)) then + error "asec not defined on the region -1..1" + qinterval(asec lo, asec hi) + + + -- From HyperbolicFunctionCategory + + tanh(u:%):% == qinterval(tanh inf u, tanh sup u) + + sinh(u:%):% == qinterval(sinh inf u, sinh sup u) + + sech(u:%):% == + negative? u => qinterval(sech inf u, sech sup u) + positive? u => qinterval(sech sup u, sech inf u) + vals : List R := sort [sech inf u, sech sup u] + exactSupInterval(first vals,1) + + + cosh(u:%):% == + negative? u => qinterval(cosh sup u, cosh inf u) + positive? u => qinterval(cosh inf u, cosh sup u) + vals : List R := sort [cosh inf u, cosh sup u] + exactInfInterval(1,last vals) + + + csch(u:%):% == + contains?(u,0) => error "csch: singularity at zero" + qinterval(csch sup u, csch inf u) + + + coth(u:%):% == + contains?(u,0) => error "coth: singularity at zero" + qinterval(coth sup u, coth inf u) + + + -- From ArcHyperbolicFunctionCategory + + acosh(u:%):% == + inf(u)<1 => error "invalid argument: acosh only defined on the region 1.." + qinterval(acosh inf u, acosh sup u) + + + acoth(u:%):% == + lo : R := inf(u) + hi : R := sup(u) + if ((lo <= -1) and (hi >= -1)) or ((lo <= 1) and (hi >= 1)) then + error "acoth not defined on the region -1..1" + qinterval(acoth hi, acoth lo) + + + acsch(u:%):% == + contains?(u,0) => error "acsch: singularity at zero" + qinterval(acsch sup u, acsch inf u) + + + asech(u:%):% == + lo : R := inf(u) + hi : R := sup(u) + if (lo <= 0) or (hi > 1) then + error "asech only defined on the region 0 < x <= 1" + qinterval(asech hi, asech lo) + + + asinh(u:%):% == qinterval(asinh inf u, asinh sup u) + + atanh(u:%):% == + lo : R := inf(u) + hi : R := sup(u) + if (lo <= -1) or (hi >= 1) then + error "atanh only defined on the region -1 < x < 1" + qinterval(atanh lo, atanh hi) + + + -- From RadicalCategory + _*_* (u:%,n:Fraction Integer):% == interval(inf(u)**n,sup(u)**n) + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Chapter J} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Chapter K} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain KERNEL Kernel} +<>= +-- kl.spad.pamphlet Kernel.input +)spool Kernel.output +)set message test on +)set message auto off +)clear all +--S 1 of 19 +x :: Expression Integer +--R +--R +--R (1) x +--R Type: Expression Integer +--E 1 + +--S 2 of 19 +kernel x +--R +--R +--R (2) x +--R Type: Kernel Expression Integer +--E 2 + +--S 3 of 19 +sin(x) + cos(x) +--R +--R +--R (3) sin(x) + cos(x) +--R Type: Expression Integer +--E 3 + +--S 4 of 19 +kernels % +--R +--R +--R (4) [sin(x),cos(x)] +--R Type: List Kernel Expression Integer +--E 4 + +--S 5 of 19 +sin(x)**2 + sin(x) + cos(x) +--R +--R +--R 2 +--R (5) sin(x) + sin(x) + cos(x) +--R Type: Expression Integer +--E 5 + +--S 6 of 19 +kernels % +--R +--R +--R (6) [sin(x),cos(x)] +--R Type: List Kernel Expression Integer +--E 6 + +--S 7 of 19 +kernels(1 :: Expression Integer) +--R +--R +--R (7) [] +--R Type: List Kernel Expression Integer +--E 7 + +--S 8 of 19 +mainKernel(cos(x) + tan(x)) +--R +--R +--R (8) tan(x) +--R Type: Union(Kernel Expression Integer,...) +--E 8 + +--S 9 of 19 +height kernel x +--R +--R +--R (9) 1 +--R Type: PositiveInteger +--E 9 + +--S 10 of 19 +height mainKernel(sin x) +--R +--R +--R (10) 2 +--R Type: PositiveInteger +--E 10 + +--S 11 of 19 +height mainKernel(sin cos x) +--R +--R +--R (11) 3 +--R Type: PositiveInteger +--E 11 + +--S 12 of 19 +height mainKernel(sin cos (tan x + sin x)) +--R +--R +--R (12) 4 +--R Type: PositiveInteger +--E 12 + +--S 13 of 19 +operator mainKernel(sin cos (tan x + sin x)) +--R +--R +--R (13) sin +--R Type: BasicOperator +--E 13 + +--S 14 of 19 +name mainKernel(sin cos (tan x + sin x)) +--R +--R +--R (14) sin +--R Type: Symbol +--E 14 + +--S 15 of 19 +f := operator 'f +--R +--R +--R (15) f +--R Type: BasicOperator +--E 15 + +--S 16 of 19 +e := f(x, y, 10) +--R +--R +--R (16) f(x,y,10) +--R Type: Expression Integer +--E 16 + +--S 17 of 19 +is?(e, f) +--R +--R +--R (17) true +--R Type: Boolean +--E 17 + +--S 18 of 19 +is?(e, 'f) +--R +--R +--R (18) true +--R Type: Boolean +--E 18 + +--S 19 of 19 +argument mainKernel e +--R +--R +--R (19) [x,y,10] +--R Type: List Expression Integer +--E 19 +)spool +)lisp (bye) +@ +<>= +==================================================================== +Kernel examples +==================================================================== + +A kernel is a symbolic function application (such as sin(x+ y)) +or a symbol (such as x). More precisely, a non-symbol +kernel over a set S is an operator applied to a given list of +arguments from S. The operator has type BasicOperator +and the kernel object is usually part of an Expression object. + +Kernels are created implicitly for you when you create expressions. + + x :: Expression Integer + x + Type: Expression Integer + +You can directly create a "symbol" kernel by using the kernel operation. + + kernel x + x + Type: Kernel Expression Integer + +This expression has two different kernels. + + sin(x) + cos(x) + sin(x) + cos(x) + Type: Expression Integer + +The operator kernels returns a list of the kernels in an object of +type Expression. + + kernels % + [sin(x),cos(x)] + Type: List Kernel Expression Integer + +This expression also has two different kernels. + + sin(x)**2 + sin(x) + cos(x) + 2 + sin(x) + sin(x) + cos(x) + Type: Expression Integer + +The sin(x) kernel is used twice. + + kernels % + [sin(x),cos(x)] + Type: List Kernel Expression Integer + +An expression need not contain any kernels. + + kernels(1 :: Expression Integer) + [] + Type: List Kernel Expression Integer + +If one or more kernels are present, one of them is designated the main +kernel. + + mainKernel(cos(x) + tan(x)) + tan(x) + Type: Union(Kernel Expression Integer,...) + +Kernels can be nested. Use height to determine the nesting depth. + + height kernel x + 1 + Type: PositiveInteger + +This has height 2 because the x has height 1 and then we apply an +operator to that. + + height mainKernel(sin x) + 2 + Type: PositiveInteger + + height mainKernel(sin cos x) + 3 + Type: PositiveInteger + + height mainKernel(sin cos (tan x + sin x)) + 4 + Type: PositiveInteger + +Use the operator operation to extract the operator component of the +kernel. The operator has type BasicOperator. + + operator mainKernel(sin cos (tan x + sin x)) + sin + Type: BasicOperator + +Use the name operation to extract the name of the operator component +of the kernel. The name has type Symbol. This is really just a +shortcut for a two-step process of extracting the operator and then +calling name on the operator. + + name mainKernel(sin cos (tan x + sin x)) + sin + Type: Symbol + +Axiom knows about functions such as sin, cos and so on and can make +kernels and then expressions using them. To create a kernel and +expression using an arbitrary operator, use operator. + +Now f can be used to create symbolic function applications. + + f := operator 'f + f + Type: BasicOperator + + e := f(x, y, 10) + f(x,y,10) + Type: Expression Integer + +Use the is? operation to learn if the operator component of a kernel +is equal to a given operator. + + is?(e, f) + true + Type: Boolean + +You can also use a symbol or a string as the second argument to is?. + + is?(e, 'f) + true + Type: Boolean + +Use the argument operation to get a list containing the argument +component of a kernel. + + argument mainKernel e + [x,y,10] + Type: List Expression Integer + +Conceptually, an object of type Expression can be thought of a +quotient of multivariate polynomials, where the "variables" are +kernels. The arguments of the kernels are again expressions and so +the structure recurses. See Expression for examples of using kernels +to take apart expression objects. + +See Also: +o )help Expression +o )help BasicOperator +o )show Kernel +o $AXIOM/doc/src/algebra/kl.spad.dvi + +@ +\pagehead{Kernel}{KERNEL} +\pagepic{ps/v103kernel.ps}{KERNEL}{1.00} +See also:\\ +\refto{MakeCachableSet}{MKCHSET} +<>= +)abbrev domain KERNEL Kernel +++ Operators applied to elements of a set +++ Author: Manuel Bronstein +++ Date Created: 22 March 1988 +++ Date Last Updated: 10 August 1994 +++ Description: +++ A kernel over a set S is an operator applied to a given list +++ of arguments from S. +Kernel(S:OrderedSet): Exports == Implementation where + O ==> OutputForm + N ==> NonNegativeInteger + OP ==> BasicOperator + + SYMBOL ==> "%symbol" + PMPRED ==> "%pmpredicate" + PMOPT ==> "%pmoptional" + PMMULT ==> "%pmmultiple" + PMCONST ==> "%pmconstant" + SPECIALDISP ==> "%specialDisp" + SPECIALEQUAL ==> "%specialEqual" + SPECIALINPUT ==> "%specialInput" + + Exports ==> Join(CachableSet, Patternable S) with + name : % -> Symbol + ++ name(op(a1,...,an)) returns the name of op. + operator: % -> OP + ++ operator(op(a1,...,an)) returns the operator op. + argument: % -> List S + ++ argument(op(a1,...,an)) returns \spad{[a1,...,an]}. + height : % -> N + ++ height(k) returns the nesting level of k. + kernel : (OP, List S, N) -> % + ++ kernel(op, [a1,...,an], m) returns the kernel \spad{op(a1,...,an)} + ++ of nesting level m. + ++ Error: if op is k-ary for some k not equal to m. + kernel : Symbol -> % + ++ kernel(x) returns x viewed as a kernel. + symbolIfCan: % -> Union(Symbol, "failed") + ++ symbolIfCan(k) returns k viewed as a symbol if k is a symbol, and + ++ "failed" otherwise. + is? : (%, OP) -> Boolean + ++ is?(op(a1,...,an), f) tests if op = f. + is? : (%, Symbol) -> Boolean + ++ is?(op(a1,...,an), s) tests if the name of op is s. + if S has ConvertibleTo InputForm then ConvertibleTo InputForm + + Implementation ==> add + import SortedCache(%) + + Rep := Record(op:OP, arg:List S, nest:N, posit:N) + + clearCache() + + B2Z : Boolean -> Integer + triage: (%, %) -> Integer + preds : OP -> List Any + + is?(k:%, s:Symbol) == is?(operator k, s) + is?(k:%, o:OP) == (operator k) = o + name k == name operator k + height k == k.nest + operator k == k.op + argument k == k.arg + position k == k.posit + setPosition(k, n) == k.posit := n + B2Z flag == (flag => -1; 1) + kernel s == kernel(assert(operator(s,0),SYMBOL), nil(), 1) + + preds o == + (u := property(o, PMPRED)) case "failed" => nil() + (u::None) pretend List(Any) + + symbolIfCan k == + has?(operator k, SYMBOL) => name operator k + "failed" + + k1 = k2 == + if k1.posit = 0 then enterInCache(k1, triage) + if k2.posit = 0 then enterInCache(k2, triage) + k1.posit = k2.posit + + k1 < k2 == + if k1.posit = 0 then enterInCache(k1, triage) + if k2.posit = 0 then enterInCache(k2, triage) + k1.posit < k2.posit + + kernel(fn, x, n) == + ((u := arity fn) case N) and (#x ^= u::N) + => error "Wrong number of arguments" + enterInCache([fn, x, n, 0]$Rep, triage) + + -- SPECIALDISP contains a map List S -> OutputForm + -- it is used when the converting the arguments first is not good, + -- for instance with formal derivatives. + coerce(k:%):OutputForm == + (v := symbolIfCan k) case Symbol => v::Symbol::OutputForm + (f := property(o := operator k, SPECIALDISP)) case None => + ((f::None) pretend (List S -> OutputForm)) (argument k) + l := [x::OutputForm for x in argument k]$List(OutputForm) + (u := display o) case "failed" => prefix(name(o)::OutputForm, l) + (u::(List OutputForm -> OutputForm)) l + + triage(k1, k2) == + k1.nest ^= k2.nest => B2Z(k1.nest < k2.nest) + k1.op ^= k2.op => B2Z(k1.op < k2.op) + (n1 := #(argument k1)) ^= (n2 := #(argument k2)) => B2Z(n1 < n2) + ((func := property(operator k1, SPECIALEQUAL)) case None) and + (((func::None) pretend ((%, %) -> Boolean)) (k1, k2)) => 0 + for x1 in argument(k1) for x2 in argument(k2) repeat + x1 ^= x2 => return B2Z(x1 < x2) + 0 + + if S has ConvertibleTo InputForm then + convert(k:%):InputForm == + (v := symbolIfCan k) case Symbol => convert(v::Symbol)@InputForm + (f := property(o := operator k, SPECIALINPUT)) case None => + ((f::None) pretend (List S -> InputForm)) (argument k) + l := [convert x for x in argument k]$List(InputForm) + (u := input operator k) case "failed" => + convert concat(convert name operator k, l) + (u::(List InputForm -> InputForm)) l + + if S has ConvertibleTo Pattern Integer then + convert(k:%):Pattern(Integer) == + o := operator k + (v := symbolIfCan k) case Symbol => + s := patternVariable(v::Symbol, + has?(o, PMCONST), has?(o, PMOPT), has?(o, PMMULT)) + empty?(l := preds o) => s + setPredicates(s, l) + o [convert x for x in k.arg]$List(Pattern Integer) + + if S has ConvertibleTo Pattern Float then + convert(k:%):Pattern(Float) == + o := operator k + (v := symbolIfCan k) case Symbol => + s := patternVariable(v::Symbol, + has?(o, PMCONST), has?(o, PMOPT), has?(o, PMMULT)) + empty?(l := preds o) => s + setPredicates(s, l) + o [convert x for x in k.arg]$List(Pattern Float) + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain KAFILE KeyedAccessFile} <>= -- files.spad.pamphlet KeyedAccessFile.input @@ -26880,6 +31545,169 @@ KeyedAccessFile(Entry): KAFcategory == KAFcapsule where %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Chapter L} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain LAUPOL LaurentPolynomial} +\pagehead{LaurentPolynomial}{LAUPOL} +\pagepic{ps/v103laurentpolynomial.ps}{LAUPOL}{1.00} +<>= +)abbrev domain LAUPOL LaurentPolynomial +++ Univariate polynomials with negative and positive exponents. +++ Author: Manuel Bronstein +++ Date Created: May 1988 +++ Date Last Updated: 26 Apr 1990 +LaurentPolynomial(R, UP): Exports == Implementation where + R : IntegralDomain + UP: UnivariatePolynomialCategory R + + O ==> OutputForm + B ==> Boolean + N ==> NonNegativeInteger + Z ==> Integer + RF ==> Fraction UP + + Exports ==> Join(DifferentialExtension UP, IntegralDomain, + ConvertibleTo RF, FullyRetractableTo R, RetractableTo UP) with + monomial? : % -> B + ++ monomial?(x) \undocumented + degree : % -> Z + ++ degree(x) \undocumented + order : % -> Z + ++ order(x) \undocumented + reductum : % -> % + ++ reductum(x) \undocumented + leadingCoefficient : % -> R + ++ leadingCoefficient \undocumented + trailingCoefficient: % -> R + ++ trailingCoefficient \undocumented + coefficient : (%, Z) -> R + ++ coefficient(x,n) \undocumented + monomial : (R, Z) -> % + ++ monomial(x,n) \undocumented + if R has CharacteristicZero then CharacteristicZero + if R has CharacteristicNonZero then CharacteristicNonZero + if R has Field then + EuclideanDomain + separate: RF -> Record(polyPart:%, fracPart:RF) + ++ separate(x) \undocumented + + Implementation ==> add + Rep := Record(polypart: UP, order0: Z) + + poly : % -> UP + check0 : (Z, UP) -> % + mkgpol : (Z, UP) -> % + gpol : (UP, Z) -> % + toutput: (R, Z, O) -> O + monTerm: (R, Z, O) -> O + + 0 == [0, 0] + 1 == [1, 0] + p = q == p.order0 = q.order0 and p.polypart = q.polypart + poly p == p.polypart + order p == p.order0 + gpol(p, n) == [p, n] + monomial(r, n) == check0(n, r::UP) + coerce(p:UP):% == mkgpol(0, p) + reductum p == check0(order p, reductum poly p) + n:Z * p:% == check0(order p, n * poly p) + characteristic() == characteristic()$R + coerce(n:Z):% == n::R::% + degree p == degree(poly p)::Z + order p + monomial? p == monomial? poly p + coerce(r:R):% == gpol(r::UP, 0) + convert(p:%):RF == poly(p) * (monomial(1, 1)$UP)::RF ** order p + p:% * q:% == check0(order p + order q, poly p * poly q) + - p == gpol(- poly p, order p) + check0(n, p) == (zero? p => 0; gpol(p, n)) + trailingCoefficient p == coefficient(poly p, 0) + leadingCoefficient p == leadingCoefficient poly p + + coerce(p:%):O == + zero? p => 0::Z::O + l := nil()$List(O) + v := monomial(1, 1)$UP :: O + while p ^= 0 repeat + l := concat(l, toutput(leadingCoefficient p, degree p, v)) + p := reductum p + reduce("+", l) + + coefficient(p, n) == + (m := n - order p) < 0 => 0 + coefficient(poly p, m::N) + + differentiate(p:%, derivation:UP -> UP) == + t := monomial(1, 1)$UP + mkgpol(order(p) - 1, + derivation(poly p) * t + order(p) * poly(p) * derivation t) + + monTerm(r, n, v) == + zero? n => r::O +-- one? n => v + (n = 1) => v + v ** (n::O) + + toutput(r, n, v) == + mon := monTerm(r, n, v) +-- zero? n or one? r => mon + zero? n or (r = 1) => mon + r = -1 => - mon + r::O * mon + + recip p == + (q := recip poly p) case "failed" => "failed" + gpol(q::UP, - order p) + + p + q == + zero? q => p + zero? p => q + (d := order p - order q) > 0 => + gpol(poly(p) * monomial(1, d::N) + poly q, order q) + d < 0 => gpol(poly(p) + poly(q) * monomial(1, (-d)::N), order p) + mkgpol(order p, poly(p) + poly q) + + mkgpol(n, p) == + zero? p => 0 + d := order(p, monomial(1, 1)$UP) + gpol((p exquo monomial(1, d))::UP, n + d::Z) + + p exquo q == + (r := poly(p) exquo poly q) case "failed" => "failed" + check0(order p - order q, r::UP) + + retractIfCan(p:%):Union(UP, "failed") == + order(p) < 0 => error "Not retractable" + poly(p) * monomial(1, order(p)::N)$UP + + retractIfCan(p:%):Union(R, "failed") == + order(p) ^= 0 => "failed" + retractIfCan poly p + + if R has Field then + gcd(p, q) == gcd(poly p, poly q)::% + + separate f == + n := order(q := denom f, monomial(1, 1)) + q := (q exquo (tn := monomial(1, n)$UP))::UP + bc := extendedEuclidean(tn,q,numer f)::Record(coef1:UP,coef2:UP) + qr := divide(bc.coef1, q) + [mkgpol(-n, bc.coef2 + tn * qr.quotient), qr.remainder / q] + +-- returns (z, r) s.t. p = q z + r, +-- and degree(r) < degree(q), order(r) >= min(order(p), order(q)) + divide(p, q) == + c := min(order p, order q) + qr := divide(poly(p) * monomial(1, (order p - c)::N)$UP, poly q) + [mkgpol(c - order q, qr.quotient), mkgpol(c, qr.remainder)] + + euclideanSize p == degree poly p + + extendedEuclidean(a, b, c) == + (bc := extendedEuclidean(poly a, poly b, poly c)) case "failed" + => "failed" + [mkgpol(order c - order a, bc.coef1), + mkgpol(order c - order b, bc.coef2)] + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain LIB Library} <>= -- files.spad.pamphlet Library.input @@ -26992,6 +31820,800 @@ Library(): TableAggregate(String, Any) with @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain LIST List} +<>= +-- list.spad.pamphlet List.input +)spool List.output +)set message test on +)set message auto off +)clear all +--S 1 of 34 +[2, 4, 5, 6] +--R +--R +--R (1) [2,4,5,6] +--R Type: List PositiveInteger +--E 1 + +--S 2 of 34 +[1] +--R +--R +--R (2) [1] +--R Type: List PositiveInteger +--E 2 + +--S 3 of 34 +list(1) +--R +--R +--R (3) [1] +--R Type: List PositiveInteger +--E 3 + +--S 4 of 34 +append([1,2,3],[5,6,7]) +--R +--R +--R (4) [1,2,3,5,6,7] +--R Type: List PositiveInteger +--E 4 + +--S 5 of 34 +cons(10,[9,8,7]) +--R +--R +--R (5) [10,9,8,7] +--R Type: List PositiveInteger +--E 5 + +--S 6 of 34 +empty? [x+1] +--R +--R +--R (6) false +--R Type: Boolean +--E 6 + +--S 7 of 34 +([] = nil)@Boolean +--R +--R +--R (7) true +--R Type: Boolean +--E 7 + +--S 8 of 34 +k := [4,3,7,3,8,5,9,2] +--R +--R +--R (8) [4,3,7,3,8,5,9,2] +--R Type: List PositiveInteger +--E 8 + +--S 9 of 34 +first k +--R +--R +--R (9) 4 +--R Type: PositiveInteger +--E 9 + +--S 10 of 34 +k.first +--R +--R +--R (10) 4 +--R Type: PositiveInteger +--E 10 + +--S 11 of 34 +k.1 +--R +--R +--R (11) 4 +--R Type: PositiveInteger +--E 11 + +--S 12 of 34 +k(1) +--R +--R +--R (12) 4 +--R Type: PositiveInteger +--E 12 + +--S 13 of 34 +n := #k +--R +--R +--R (13) 8 +--R Type: PositiveInteger +--E 13 + +--S 14 of 34 +last k +--R +--R +--R (14) 2 +--R Type: PositiveInteger +--E 14 + +--S 15 of 34 +k.last +--R +--R +--R (15) 2 +--R Type: PositiveInteger +--E 15 + +--S 16 of 34 +k.(#k) +--R +--R +--R (16) 2 +--R Type: PositiveInteger +--E 16 + +--S 17 of 34 +k := [4,3,7,3,8,5,9,2] +--R +--R +--R (17) [4,3,7,3,8,5,9,2] +--R Type: List PositiveInteger +--E 17 + +--S 18 of 34 +k.1 := 999 +--R +--R +--R (18) 999 +--R Type: PositiveInteger +--E 18 + +--S 19 of 34 +k +--R +--R +--R (19) [999,3,7,3,8,5,9,2] +--R Type: List PositiveInteger +--E 19 + +--S 20 of 34 +k := [1,2] +--R +--R +--R (20) [1,2] +--R Type: List PositiveInteger +--E 20 + +--S 21 of 34 +m := cons(0,k) +--R +--R +--R (21) [0,1,2] +--R Type: List Integer +--E 21 + +--S 22 of 34 +m.2 := 99 +--R +--R +--R (22) 99 +--R Type: PositiveInteger +--E 22 + +--S 23 of 34 +m +--R +--R +--R (23) [0,99,2] +--R Type: List Integer +--E 23 + +--S 24 of 34 +k +--R +--R +--R (24) [99,2] +--R Type: List PositiveInteger +--E 24 + +--S 25 of 34 +k := [1,2,3] +--R +--R +--R (25) [1,2,3] +--R Type: List PositiveInteger +--E 25 + +--S 26 of 34 +rest k +--R +--R +--R (26) [2,3] +--R Type: List PositiveInteger +--E 26 + +--S 27 of 34 +removeDuplicates [4,3,4,3,5,3,4] +--R +--R +--R (27) [4,3,5] +--R Type: List PositiveInteger +--E 27 + +--S 28 of 34 +reverse [1,2,3,4,5,6] +--R +--R +--R (28) [6,5,4,3,2,1] +--R Type: List PositiveInteger +--E 28 + +--S 29 of 34 +member?(1/2,[3/4,5/6,1/2]) +--R +--R +--R (29) true +--R Type: Boolean +--E 29 + +--S 30 of 34 +member?(1/12,[3/4,5/6,1/2]) +--R +--R +--R (30) false +--R Type: Boolean +--E 30 + +--S 31 of 34 +reverse(rest(reverse(k))) +--R +--R +--R (31) [1,2] +--R Type: List PositiveInteger +--E 31 + +--S 32 of 34 +[1..3,10,20..23] +--R +--R +--R (32) [1..3,10..10,20..23] +--R Type: List Segment PositiveInteger +--E 32 + +--S 33 of 34 +expand [1..3,10,20..23] +--R +--R +--R (33) [1,2,3,10,20,21,22,23] +--R Type: List Integer +--E 33 + +--S 34 of 34 +expand [1..] +--R +--R +--R (34) [1,2,3,4,5,6,7,8,9,10,...] +--R Type: Stream Integer +--E 34 +)spool +)lisp (bye) +@ +<>= +==================================================================== +List examples +==================================================================== + +A list is a finite collection of elements in a specified order that +can contain duplicates. A list is a convenient structure to work with +because it is easy to add or remove elements and the length need not +be constant. There are many different kinds of lists in Axiom, but +the default types (and those used most often) are created by the List +constructor. For example, there are objects of type List Integer, +List Float and List Polynomial Fraction Integer. Indeed, you can even +have List List List Boolean (that is, lists of lists of lists of +Boolean values). You can have lists of any type of Axiom object. + +==================================================================== +Creating Lists +==================================================================== + +The easiest way to create a list with, for example, the elements +2, 4, 5, 6 is to enclose the elements with square brackets and +separate the elements with commas. + +The spaces after the commas are optional, but they do improve the +readability. + + [2, 4, 5, 6] + [2,4,5,6] + Type: List PositiveInteger + +To create a list with the single element 1, you can use either [1] or +the operation list. + + [1] + [1] + Type: List PositiveInteger + + list(1) + [1] + Type: List PositiveInteger + +Once created, two lists k and m can be concatenated by issuing +append(k,m). append does not physically join the lists, but rather +produces a new list with the elements coming from the two arguments. + + append([1,2,3],[5,6,7]) + [1,2,3,5,6,7] + Type: List PositiveInteger + +Use cons to append an element onto the front of a list. + + cons(10,[9,8,7]) + [10,9,8,7] + Type: List PositiveInteger + +==================================================================== +Accessing List Elements +==================================================================== + +To determine whether a list has any elements, use the operation empty?. + + empty? [x+1] + false + Type: Boolean + +Alternatively, equality with the list constant nil can be tested. + + ([] = nil)@Boolean + true + Type: Boolean + +We'll use this in some of the following examples. + + k := [4,3,7,3,8,5,9,2] + [4,3,7,3,8,5,9,2] + Type: List PositiveInteger + +Each of the next four expressions extracts the first element of k. + + first k + 4 + Type: PositiveInteger + + k.first + 4 + Type: PositiveInteger + + k.1 + 4 + Type: PositiveInteger + + k(1) + 4 + Type: PositiveInteger + +The last two forms generalize to k.i and k(i), respectively, where +1 <= i <= n and n equals the length of k. + +This length is calculated by #. + + n := #k + 8 + Type: PositiveInteger + +Performing an operation such as k.i is sometimes referred to as +indexing into k or elting into k. The latter phrase comes about +because the name of the operation that extracts elements is called +elt. That is, k.3 is just alternative syntax for elt(k,3). It is +important to remember that list indices begin with 1. If we issue +k := [1,3,2,9,5] then k.4 returns 9. It is an error to use an index +that is not in the range from 1 to the length of the list. + +The last element of a list is extracted by any of the following three +expressions. + + last k + 2 + Type: PositiveInteger + + k.last + 2 + Type: PositiveInteger + +This form computes the index of the last element and then extracts the +element from the list. + + k.(#k) + 2 + Type: PositiveInteger + +==================================================================== +Changing List Elements +==================================================================== + +We'll use this in some of the following examples. + + k := [4,3,7,3,8,5,9,2] + [4,3,7,3,8,5,9,2] + Type: List PositiveInteger + +List elements are reset by using the k.i form on the left-hand side of +an assignment. This expression resets the first element of k to 999. + + k.1 := 999 + 999 + Type: PositiveInteger + +As with indexing into a list, it is an error to use an index that is +not within the proper bounds. Here you see that k was modified. + + k + [999,3,7,3,8,5,9,2] + Type: List PositiveInteger + +The operation that performs the assignment of an element to a +particular position in a list is called setelt. This operation is +destructive in that it changes the list. In the above example, the +assignment returned the value 999 and k was modified. For this +reason, lists are called mutable objects: it is possible to change +part of a list (mutate it) rather than always returning a new list +reflecting the intended modifications. + +Moreover, since lists can share structure, changes to one list can +sometimes affect others. + + k := [1,2] + [1,2] + Type: List PositiveInteger + + m := cons(0,k) + [0,1,2] + Type: List Integer + +Change the second element of m. + + m.2 := 99 + 99 + Type: PositiveInteger + +See, m was altered. + + m + [0,99,2] + Type: List Integer + +But what about k? It changed too! + + k + [99,2] + Type: List PositiveInteger + +==================================================================== +Other Functions +==================================================================== + +An operation that is used frequently in list processing is that +which returns all elements in a list after the first element. + + k := [1,2,3] + [1,2,3] + Type: List PositiveInteger + +Use the rest operation to do this. + + rest k + [2,3] + Type: List PositiveInteger + +To remove duplicate elements in a list k, use removeDuplicates. + + removeDuplicates [4,3,4,3,5,3,4] + [4,3,5] + Type: List PositiveInteger + +To get a list with elements in the order opposite to those in a list +k, use reverse. + + reverse [1,2,3,4,5,6] + [6,5,4,3,2,1] + Type: List PositiveInteger + +To test whether an element is in a list, use member?: member?(a,k) +returns true or false depending on whether a is in k or not. + + member?(1/2,[3/4,5/6,1/2]) + true + Type: Boolean + + member?(1/12,[3/4,5/6,1/2]) + false + Type: Boolean + +We can get a list containing all but the last of the elements in a +given non-empty list k. + + reverse(rest(reverse(k))) + [1,2] + Type: List PositiveInteger + +==================================================================== +Dot, Dot +==================================================================== + +Certain lists are used so often that Axiom provides an easy way of +constructing them. If n and m are integers, then expand [n..m] +creates a list containing n, n+1, ... m. If n > m then the list is +empty. It is actually permissible to leave off the m in the dot-dot +construction (see below). + +The dot-dot notation can be used more than once in a list construction +and with specific elements being given. Items separated by dots are +called segments. + + [1..3,10,20..23] + [1..3,10..10,20..23] + Type: List Segment PositiveInteger + +Segments can be expanded into the range of items between the endpoints +by using expand. + + expand [1..3,10,20..23] + [1,2,3,10,20,21,22,23] + Type: List Integer + +What happens if we leave off a number on the right-hand side of ..? + + expand [1..] + [1,2,3,4,5,6,7,8,9,10,...] + Type: Stream Integer + +What is created in this case is a Stream which is a generalization of +a list. + +See Also: +o )help Stream +o )show List +o $AXIOM/doc/src/algebra/list.spad.dvi + +@ +\pagehead{List}{LIST} +\pagepic{ps/v103list.ps}{LIST}{1.00} +See also:\\ +\refto{IndexedList}{ILIST} +\refto{AssociationList}{ALIST} +<>= +)abbrev domain LIST List +++ Author: Michael Monagan +++ Date Created: Sep 1987 +++ Change History: +++ Basic Operations: +++ \#, append, concat, concat!, cons, construct, copy, elt, elt, +++ empty, empty?, eq?, first, member?, merge!, mergeSort, minIndex, +++ nil, null, parts, removeDuplicates!, rest, rest, reverse, +++ reverse!, setDifference, setIntersection, setUnion, setelt, +++ setfirst!, setrest!, sort!, split! +++ Related Constructors: ListFunctions2, ListFunctions3, ListToMap +++ Also See: IndexList, ListAggregate +++ AMS Classification: +++ Keywords: list, index, aggregate, lisp +++ Description: +++ \spadtype{List} implements singly-linked lists that are +++ addressable by indices; the index of the first element +++ is 1. In addition to the operations provided by +++ \spadtype{IndexedList}, this constructor provides some +++ LISP-like functions such as \spadfun{null} and \spadfun{cons}. +List(S:Type): Exports == Implementation where + LISTMININDEX ==> 1 -- this is the minimum list index + + Exports ==> ListAggregate S with + nil : () -> % + ++ nil() returns the empty list. + null : % -> Boolean + ++ null(u) tests if list \spad{u} is the + ++ empty list. + cons : (S, %) -> % + ++ cons(element,u) appends \spad{element} onto the front + ++ of list \spad{u} and returns the new list. This new list + ++ and the old one will share some structure. + append : (%, %) -> % + ++ append(u1,u2) appends the elements of list \spad{u1} + ++ onto the front of list \spad{u2}. This new list + ++ and \spad{u2} will share some structure. + if S has SetCategory then + setUnion : (%, %) -> % + ++ setUnion(u1,u2) appends the two lists u1 and u2, then + ++ removes all duplicates. The order of elements in the + ++ resulting list is unspecified. + setIntersection : (%, %) -> % + ++ setIntersection(u1,u2) returns a list of the elements + ++ that lists \spad{u1} and \spad{u2} have in common. + ++ The order of elements in the resulting list is unspecified. + setDifference : (%, %) -> % + ++ setDifference(u1,u2) returns a list of the elements + ++ of \spad{u1} that are not also in \spad{u2}. + ++ The order of elements in the resulting list is unspecified. + if S has OpenMath then OpenMath + + Implementation ==> + IndexedList(S, LISTMININDEX) add + nil() == NIL$Lisp + null l == NULL(l)$Lisp + cons(s, l) == CONS(s, l)$Lisp + append(l:%, t:%) == APPEND(l, t)$Lisp + + if S has OpenMath then + writeOMList(dev: OpenMathDevice, x: %): Void == + OMputApp(dev) + OMputSymbol(dev, "list1", "list") + -- The following didn't compile because the compiler isn't + -- convinced that `xval' is a S. Duhhh! MCD. + --for xval in x repeat + -- OMwrite(dev, xval, false) + while not null x repeat + OMwrite(dev,first x,false) + x := rest x + OMputEndApp(dev) + + OMwrite(x: %): String == + s: String := "" + sp := OM_-STRINGTOSTRINGPTR(s)$Lisp + dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML) + OMputObject(dev) + writeOMList(dev, x) + OMputEndObject(dev) + OMclose(dev) + s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String + s + + OMwrite(x: %, wholeObj: Boolean): String == + s: String := "" + sp := OM_-STRINGTOSTRINGPTR(s)$Lisp + dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML) + if wholeObj then + OMputObject(dev) + writeOMList(dev, x) + if wholeObj then + OMputEndObject(dev) + OMclose(dev) + s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String + s + + OMwrite(dev: OpenMathDevice, x: %): Void == + OMputObject(dev) + writeOMList(dev, x) + OMputEndObject(dev) + + OMwrite(dev: OpenMathDevice, x: %, wholeObj: Boolean): Void == + if wholeObj then + OMputObject(dev) + writeOMList(dev, x) + if wholeObj then + OMputEndObject(dev) + + if S has SetCategory then + setUnion(l1:%,l2:%) == removeDuplicates concat(l1,l2) + + setIntersection(l1:%,l2:%) == + u :% := empty() + l1 := removeDuplicates l1 + while not empty? l1 repeat + if member?(first l1,l2) then u := cons(first l1,u) + l1 := rest l1 + u + + setDifference(l1:%,l2:%) == + l1 := removeDuplicates l1 + lu:% := empty() + while not empty? l1 repeat + l11:=l1.1 + if not member?(l11,l2) then lu := concat(l11,lu) + l1 := rest l1 + lu + + if S has ConvertibleTo InputForm then + convert(x:%):InputForm == + convert concat(convert("construct"::Symbol)@InputForm, + [convert a for a in (x pretend List S)]$List(InputForm)) + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain LSQM LieSquareMatrix} +\pagehead{LieSquareMatrix}{LSQM} +\pagepic{ps/v103liesquarematrix.ps}{LSQM}{1.00} +See also:\\ +\refto{AssociatedLieAlgebra}{LIE} +\refto{AssociatedJordanAlgebra}{JORDAN} +<>= +)abbrev domain LSQM LieSquareMatrix +++ Author: J. Grabmeier +++ Date Created: 07 March 1991 +++ Date Last Updated: 08 March 1991 +++ Basic Operations: +++ Related Constructors: +++ Also See: +++ AMS Classifications: +++ Keywords: +++ References: +++ Description: +++ LieSquareMatrix(n,R) implements the Lie algebra of the n by n +++ matrices over the commutative ring R. +++ The Lie bracket (commutator) of the algebra is given by +++ \spad{a*b := (a *$SQMATRIX(n,R) b - b *$SQMATRIX(n,R) a)}, +++ where \spadfun{*$SQMATRIX(n,R)} is the usual matrix multiplication. +LieSquareMatrix(n,R): Exports == Implementation where + + n : PositiveInteger + R : CommutativeRing + + Row ==> DirectProduct(n,R) + Col ==> DirectProduct(n,R) + + Exports ==> Join(SquareMatrixCategory(n,R,Row,Col), CoercibleTo Matrix R,_ + FramedNonAssociativeAlgebra R) --with + + Implementation ==> AssociatedLieAlgebra (R,SquareMatrix(n, R)) add + + Rep := AssociatedLieAlgebra (R,SquareMatrix(n, R)) + -- local functions + n2 : PositiveInteger := n*n + + convDM : DirectProduct(n2,R) -> % + conv : DirectProduct(n2,R) -> SquareMatrix(n,R) + --++ converts n2-vector to (n,n)-matrix row by row + conv v == + cond : Matrix(R) := new(n,n,0$R)$Matrix(R) + z : Integer := 0 + for i in 1..n repeat + for j in 1..n repeat + z := z+1 + setelt(cond,i,j,v.z) + squareMatrix(cond)$SquareMatrix(n, R) + + + coordinates(a:%,b:Vector(%)):Vector(R) == + -- only valid for b canonicalBasis + res : Vector R := new(n2,0$R) + z : Integer := 0 + for i in 1..n repeat + for j in 1..n repeat + z := z+1 + res.z := elt(a,i,j)$% + res + + + convDM v == + sq := conv v + coerce(sq)$Rep :: % + + basis() == + n2 : PositiveInteger := n*n + ldp : List DirectProduct(n2,R) := + [unitVector(i::PositiveInteger)$DirectProduct(n2,R) for i in 1..n2] + res:Vector % := vector map(convDM,_ + ldp)$ListFunctions2(DirectProduct(n2,R), %) + + someBasis() == basis() + rank() == n*n + + +-- transpose: % -> % +-- ++ computes the transpose of a matrix +-- squareMatrix: Matrix R -> % +-- ++ converts a Matrix to a LieSquareMatrix +-- coerce: % -> Matrix R +-- ++ converts a LieSquareMatrix to a Matrix +-- symdecomp : % -> Record(sym:%,antisym:%) +-- if R has commutative("*") then +-- minorsVect: -> Vector(Union(R,"uncomputed")) --range: 1..2**n-1 +-- if R has commutative("*") then central +-- if R has commutative("*") and R has unitsKnown then unitsKnown + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain LMOPS ListMonoidOps} \pagehead{ListMonoidOps}{LMOPS} \pagepic{ps/v103listmonoidops.ps}{LMOPS}{1.00} @@ -27195,12 +32817,12 @@ LocalAlgebra(A: Algebra R, @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain LO Localize} -<>= \pagehead{Localize}{LO} \pagepic{ps/v103localize.ps}{LO}{1.00} See also:\\ \refto{LocalAlgebra}{LA} \refto{Fraction}{FRAC} +<>= )abbrev domain LO Localize ++ Author: Dave Barton, Barry Trager ++ Date Created: @@ -27693,6 +33315,49 @@ MachineInteger(): Exports == Implementation where @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain MKCHSET MakeCachableSet} +\pagehead{MakeCachableSet}{MKCHSET} +\pagepic{ps/v103makecachableset.ps}{MKCHSET}{1.00} +See also:\\ +\refto{Kernel}{KERNEL} +<>= +)abbrev domain MKCHSET MakeCachableSet +++ Make a cachable set from any set +++ Author: Manuel Bronstein +++ Date Created: ??? +++ Date Last Updated: 14 May 1991 +++ Description: +++ MakeCachableSet(S) returns a cachable set which is equal to S as a set. +MakeCachableSet(S:SetCategory): Exports == Implementation where + Exports ==> Join(CachableSet, CoercibleTo S) with + coerce: S -> % + ++ coerce(s) returns s viewed as an element of %. + + Implementation ==> add + import SortedCache(%) + + Rep := Record(setpart: S, pos: NonNegativeInteger) + + clearCache() + + position x == x.pos + setPosition(x, n) == (x.pos := n; void) + coerce(x:%):S == x.setpart + coerce(x:%):OutputForm == x::S::OutputForm + coerce(s:S):% == enterInCache([s, 0]$Rep, s = #1::S) + + x < y == + if position(x) = 0 then enterInCache(x, x::S = #1::S) + if position(y) = 0 then enterInCache(y, y::S = #1::S) + position(x) < position(y) + + x = y == + if position(x) = 0 then enterInCache(x, x::S = #1::S) + if position(y) = 0 then enterInCache(y, y::S = #1::S) + position(x) = position(y) + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Chapter N} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain NONE None} @@ -27792,6 +33457,56 @@ None():SetCategory == add @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain NNI NonNegativeInteger} +\pagehead{NonNegativeInteger}{NNI} +\pagepic{ps/v103nonnegativeinteger.ps}{NNI}{1.00} +See also:\\ +\refto{Integer}{INT} +\refto{PositiveInteger}{PI} +\refto{RomanNumeral}{ROMAN} +<>= +)abbrev domain NNI NonNegativeInteger +++ Author: +++ Date Created: +++ Change History: +++ Basic Operations: +++ Related Constructors: +++ Keywords: integer +++ Description: \spadtype{NonNegativeInteger} provides functions for non +++ negative integers. +NonNegativeInteger: Join(OrderedAbelianMonoidSup,Monoid) with + _quo : (%,%) -> % + ++ a quo b returns the quotient of \spad{a} and b, forgetting + ++ the remainder. + _rem : (%,%) -> % + ++ a rem b returns the remainder of \spad{a} and b. + gcd : (%,%) -> % + ++ gcd(a,b) computes the greatest common divisor of two + ++ non negative integers \spad{a} and b. + divide: (%,%) -> Record(quotient:%,remainder:%) + ++ divide(a,b) returns a record containing both + ++ remainder and quotient. + _exquo: (%,%) -> Union(%,"failed") + ++ exquo(a,b) returns the quotient of \spad{a} and b, or "failed" + ++ if b is zero or \spad{a} rem b is zero. + shift: (%, Integer) -> % + ++ shift(a,i) shift \spad{a} by i bits. + random : % -> % + ++ random(n) returns a random integer from 0 to \spad{n-1}. + commutative("*") + ++ commutative("*") means multiplication is commutative : \spad{x*y = y*x}. + + == SubDomain(Integer,#1 >= 0) add + x,y:% + sup(x,y) == MAX(x,y)$Lisp + shift(x:%, n:Integer):% == ASH(x,n)$Lisp + subtractIfCan(x, y) == + c:Integer := (x pretend Integer) - (y pretend Integer) + c < 0 => "failed" + c pretend % + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain NIPROB NumericalIntegrationProblem} \pagehead{NumericalIntegrationProblem}{NIPROB} \pagepic{ps/v103numericalintegrationproblem.ps}{NIPROB}{1.00} @@ -28579,6 +34294,45 @@ OrderedCompletion(R:SetCategory): Exports == Implementation where @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain ODP OrderedDirectProduct} +\pagehead{OrderedDirectProduct}{ODP} +\pagepic{ps/v103ordereddirectproduct.ps}{ODP}{1.00} +See also:\\ +\refto{HomogeneousDirectProduct}{HDP} +\refto{SplitHomogeneousDirectProduct}{SHDP} +<>= +)abbrev domain ODP OrderedDirectProduct +-- all direct product category domains must be compiled +-- without subsumption, set SourceLevelSubset to EQUAL +--)bo $noSubsumption := true + +++ Author: +++ Date Created: +++ Date Last Updated: +++ Basic Functions: +++ Related Constructors: Vector, DirectProduct +++ Also See: HomogeneousDirectProduct, SplitHomogeneousDirectProduct +++ AMS Classifications: +++ Keywords: +++ References: +++ Description: +++ This type represents the finite direct or cartesian product of an +++ underlying ordered component type. The ordering on the type is determined +++ by its third argument which represents the less than function on +++ vectors. This type is a suitable third argument for +++ \spadtype{GeneralDistributedMultivariatePolynomial}. + +OrderedDirectProduct(dim:NonNegativeInteger, + S:OrderedAbelianMonoidSup, + f:(Vector(S),Vector(S))->Boolean):T + == C where + T == DirectProductCategory(dim,S) + C == DirectProduct(dim,S) add + Rep:=Vector(S) + x:% < y:% == f(x::Rep,y::Rep) + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain ODPOL OrderlyDifferentialPolynomial} See also:\\ \refto{OrderlyDifferentialVariable}{ODVAR} @@ -29423,6 +35177,76 @@ Palette(): Exports == Implementation where @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain HACKPI Pi} +\pagehead{Pi}{HACKPI} +\pagepic{ps/v103pi.ps}{HACKPI}{1.00} +See also:\\ +\refto{Expression}{EXPR} +<>= +)abbrev domain HACKPI Pi +++ Expressions in %pi only +++ Author: Manuel Bronstein +++ Description: +++ Symbolic fractions in %pi with integer coefficients; +++ The point for using Pi as the default domain for those fractions +++ is that Pi is coercible to the float types, and not Expression. +++ Date Created: 21 Feb 1990 +++ Date Last Updated: 12 Mai 1992 +Pi(): Exports == Implementation where + PZ ==> Polynomial Integer + UP ==> SparseUnivariatePolynomial Integer + RF ==> Fraction UP + + Exports ==> Join(Field, CharacteristicZero, RetractableTo Integer, + RetractableTo Fraction Integer, RealConstant, + CoercibleTo DoubleFloat, CoercibleTo Float, + ConvertibleTo RF, ConvertibleTo InputForm) with + pi: () -> % ++ pi() returns the symbolic %pi. + Implementation ==> RF add + Rep := RF + + sympi := "%pi"::Symbol + + p2sf: UP -> DoubleFloat + p2f : UP -> Float + p2o : UP -> OutputForm + p2i : UP -> InputForm + p2p: UP -> PZ + + pi() == (monomial(1, 1)$UP :: RF) pretend % + convert(x:%):RF == x pretend RF + convert(x:%):Float == x::Float + convert(x:%):DoubleFloat == x::DoubleFloat + coerce(x:%):DoubleFloat == p2sf(numer x) / p2sf(denom x) + coerce(x:%):Float == p2f(numer x) / p2f(denom x) + p2o p == outputForm(p, sympi::OutputForm) + p2i p == convert p2p p + + p2p p == + ans:PZ := 0 + while p ^= 0 repeat + ans := ans + monomial(leadingCoefficient(p)::PZ, sympi, degree p) + p := reductum p + ans + + coerce(x:%):OutputForm == + (r := retractIfCan(x)@Union(UP, "failed")) case UP => p2o(r::UP) + p2o(numer x) / p2o(denom x) + + convert(x:%):InputForm == + (r := retractIfCan(x)@Union(UP, "failed")) case UP => p2i(r::UP) + p2i(numer x) / p2i(denom x) + + p2sf p == + map(#1::DoubleFloat, p)$SparseUnivariatePolynomialFunctions2( + Integer, DoubleFloat) (pi()$DoubleFloat) + + p2f p == + map(#1::Float, p)$SparseUnivariatePolynomialFunctions2( + Integer, Float) (pi()$Float) + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain ACPLOT PlaneAlgebraicCurvePlot} <>= -- acplot.spad.pamphlet PlaneAlgebraicCurvePlot.input @@ -29462,6 +35286,7 @@ o $AXIOM/doc/src/algebra/acplot.spad.dvi \pagehead{PlaneAlgebraicCurvePlot}{ACPLOT} \pagepic{ps/v103planealgebraiccurveplot.ps}{ACPLOT}{1.00} <>= +)abbrev domain ACPLOT PlaneAlgebraicCurvePlot --% PlaneAlgebraicCurvePlot ++ Plot a NON-SINGULAR plane algebraic curve p(x,y) = 0. ++ Author: Clifton J. Williamson and Timothy Daly @@ -29471,8 +35296,6 @@ o $AXIOM/doc/src/algebra/acplot.spad.dvi ++ Examples: ++ References: -)abbrev domain ACPLOT PlaneAlgebraicCurvePlot - PlaneAlgebraicCurvePlot(): PlottablePlaneCurveCategory _ with @@ -30676,73 +36499,455 @@ PlaneAlgebraicCurvePlot(): PlottablePlaneCurveCategory _ @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{domain HACKPI Pi} -\pagehead{Pi}{HACKPI} -\pagepic{ps/v103pi.ps}{HACKPI}{1.00} -See also:\\ -\refto{Expression}{EXPR} -<>= -)abbrev domain HACKPI Pi -++ Expressions in %pi only -++ Author: Manuel Bronstein -++ Description: -++ Symbolic fractions in %pi with integer coefficients; -++ The point for using Pi as the default domain for those fractions -++ is that Pi is coercible to the float types, and not Expression. -++ Date Created: 21 Feb 1990 -++ Date Last Updated: 12 Mai 1992 -Pi(): Exports == Implementation where - PZ ==> Polynomial Integer - UP ==> SparseUnivariatePolynomial Integer - RF ==> Fraction UP - - Exports ==> Join(Field, CharacteristicZero, RetractableTo Integer, - RetractableTo Fraction Integer, RealConstant, - CoercibleTo DoubleFloat, CoercibleTo Float, - ConvertibleTo RF, ConvertibleTo InputForm) with - pi: () -> % ++ pi() returns the symbolic %pi. - Implementation ==> RF add - Rep := RF - - sympi := "%pi"::Symbol - - p2sf: UP -> DoubleFloat - p2f : UP -> Float - p2o : UP -> OutputForm - p2i : UP -> InputForm - p2p: UP -> PZ - - pi() == (monomial(1, 1)$UP :: RF) pretend % - convert(x:%):RF == x pretend RF - convert(x:%):Float == x::Float - convert(x:%):DoubleFloat == x::DoubleFloat - coerce(x:%):DoubleFloat == p2sf(numer x) / p2sf(denom x) - coerce(x:%):Float == p2f(numer x) / p2f(denom x) - p2o p == outputForm(p, sympi::OutputForm) - p2i p == convert p2p p - - p2p p == - ans:PZ := 0 - while p ^= 0 repeat - ans := ans + monomial(leadingCoefficient(p)::PZ, sympi, degree p) - p := reductum p - ans - - coerce(x:%):OutputForm == - (r := retractIfCan(x)@Union(UP, "failed")) case UP => p2o(r::UP) - p2o(numer x) / p2o(denom x) - - convert(x:%):InputForm == - (r := retractIfCan(x)@Union(UP, "failed")) case UP => p2i(r::UP) - p2i(numer x) / p2i(denom x) - - p2sf p == - map(#1::DoubleFloat, p)$SparseUnivariatePolynomialFunctions2( - Integer, DoubleFloat) (pi()$DoubleFloat) +\section{domain IDEAL PolynomialIdeals} +\pagehead{PolynomialIdeals}{IDEAL} +\pagepic{ps/v103polynomialideals.ps}{IDEAL}{1.00} +<>= +)abbrev domain IDEAL PolynomialIdeals +++ Author: P. Gianni +++ Date Created: summer 1986 +++ Date Last Updated: September 1996 +++ Basic Functions: +++ Related Constructors: +++ Also See: +++ AMS Classifications: +++ Keywords: +++ References: GTZ +++ Description: This domain represents polynomial ideals with coefficients in any +++ field and supports the basic ideal operations, including intersection +++ sum and quotient. +++ An ideal is represented by a list of polynomials (the generators of +++ the ideal) and a boolean that is true if the generators are a Groebner +++ basis. +++ The algorithms used are based on Groebner basis computations. The +++ ordering is determined by the datatype of the input polynomials. +++ Users may use refinements of total degree orderings. + +PolynomialIdeals(F,Expon,VarSet,DPoly) : C == T + where + F : Field + Expon : OrderedAbelianMonoidSup + VarSet : OrderedSet + DPoly : PolynomialCategory(F,Expon,VarSet) + + SUP ==> SparseUnivariatePolynomial(DPoly) + NNI ==> NonNegativeInteger + Z ==> Integer + P ==> Polynomial F + MF ==> Matrix(F) + ST ==> SuchThat(List P, List Equation P) + + GenMPos ==> Record(mval:MF,invmval:MF,genIdeal:Ideal) + Ideal ==> % + + C == SetCategory with + + "*" : (Ideal,Ideal) -> Ideal + ++ I*J computes the product of the ideal I and J. + "**" : (Ideal,NNI) -> Ideal + ++ I**n computes the nth power of the ideal I. + "+" : (Ideal,Ideal) -> Ideal + ++ I+J computes the ideal generated by the union of I and J. + one? : Ideal -> Boolean + ++ one?(I) tests whether the ideal I is the unit ideal, + ++ i.e. contains 1. + zero? : Ideal -> Boolean + ++ zero?(I) tests whether the ideal I is the zero ideal + element? : (DPoly,Ideal) -> Boolean + ++ element?(f,I) tests whether the polynomial f belongs to + ++ the ideal I. + in? : (Ideal,Ideal) -> Boolean + ++ in?(I,J) tests if the ideal I is contained in the ideal J. + inRadical? : (DPoly,Ideal) -> Boolean + ++ inRadical?(f,I) tests if some power of the polynomial f + ++ belongs to the ideal I. + zeroDim? : (Ideal,List VarSet) -> Boolean + ++ zeroDim?(I,lvar) tests if the ideal I is zero dimensional, i.e. + ++ all its associated primes are maximal, + ++ in the ring \spad{F[lvar]} + zeroDim? : Ideal -> Boolean + ++ zeroDim?(I) tests if the ideal I is zero dimensional, i.e. + ++ all its associated primes are maximal, + ++ in the ring \spad{F[lvar]}, where lvar are the variables appearing in I + intersect : (Ideal,Ideal) -> Ideal + ++ intersect(I,J) computes the intersection of the ideals I and J. + intersect : List(Ideal) -> Ideal + ++ intersect(LI) computes the intersection of the list of ideals LI. + quotient : (Ideal,Ideal) -> Ideal + ++ quotient(I,J) computes the quotient of the ideals I and J, \spad{(I:J)}. + quotient : (Ideal,DPoly) -> Ideal + ++ quotient(I,f) computes the quotient of the ideal I by the principal + ++ ideal generated by the polynomial f, \spad{(I:(f))}. + groebner : Ideal -> Ideal + ++ groebner(I) returns a set of generators of I that are a Groebner basis + ++ for I. + generalPosition : (Ideal,List VarSet) -> GenMPos + ++ generalPosition(I,listvar) perform a random linear + ++ transformation on the variables in listvar and returns + ++ the transformed ideal along with the change of basis matrix. + backOldPos : GenMPos -> Ideal + ++ backOldPos(genPos) takes the result + ++ produced by \spadfunFrom{generalPosition}{PolynomialIdeals} + ++ and performs the inverse transformation, returning the original ideal + ++ \spad{backOldPos(generalPosition(I,listvar))} = I. + dimension : (Ideal,List VarSet) -> Z + ++ dimension(I,lvar) gives the dimension of the ideal I, + ++ in the ring \spad{F[lvar]} + dimension : Ideal -> Z + ++ dimension(I) gives the dimension of the ideal I. + ++ in the ring \spad{F[lvar]}, where lvar are the variables appearing in I + leadingIdeal : Ideal -> Ideal + ++ leadingIdeal(I) is the ideal generated by the + ++ leading terms of the elements of the ideal I. + ideal : List DPoly -> Ideal + ++ ideal(polyList) constructs the ideal generated by the list + ++ of polynomials polyList. + groebnerIdeal : List DPoly -> Ideal + ++ groebnerIdeal(polyList) constructs the ideal generated by the list + ++ of polynomials polyList which are assumed to be a Groebner + ++ basis. + ++ Note: this operation avoids a Groebner basis computation. + groebner? : Ideal -> Boolean + ++ groebner?(I) tests if the generators of the ideal I are a Groebner basis. + generators : Ideal -> List DPoly + ++ generators(I) returns a list of generators for the ideal I. + coerce : List DPoly -> Ideal + ++ coerce(polyList) converts the list of polynomials polyList to an ideal. + + saturate : (Ideal,DPoly) -> Ideal + ++ saturate(I,f) is the saturation of the ideal I + ++ with respect to the multiplicative + ++ set generated by the polynomial f. + saturate :(Ideal,DPoly,List VarSet) -> Ideal + ++ saturate(I,f,lvar) is the saturation with respect to the prime + ++ principal ideal which is generated by f in the polynomial ring + ++ \spad{F[lvar]}. + if VarSet has ConvertibleTo Symbol then + relationsIdeal : List DPoly -> ST + ++ relationsIdeal(polyList) returns the ideal of relations among the + ++ polynomials in polyList. + + T == add + + --- Representation --- + Rep := Record(idl:List DPoly,isGr:Boolean) + + + ---- Local Functions ---- + + contractGrob : newIdeal -> Ideal + npoly : DPoly -> newPoly + oldpoly : newPoly -> Union(DPoly,"failed") + leadterm : (DPoly,VarSet) -> DPoly + choosel : (DPoly,DPoly) -> DPoly + isMonic? : (DPoly,VarSet) -> Boolean + randomat : List Z -> Record(mM:MF,imM:MF) + monomDim : (Ideal,List VarSet) -> NNI + variables : Ideal -> List VarSet + subset : List VarSet -> List List VarSet + makeleast : (List VarSet,List VarSet) -> List VarSet + + newExpon: OrderedAbelianMonoidSup + newExpon:= Product(NNI,Expon) + newPoly := PolynomialRing(F,newExpon) + + import GaloisGroupFactorizer(SparseUnivariatePolynomial Z) + import GroebnerPackage(F,Expon,VarSet,DPoly) + import GroebnerPackage(F,newExpon,VarSet,newPoly) + + newIdeal ==> List(newPoly) + + npoly(f:DPoly) : newPoly == + f=0$DPoly => 0$newPoly + monomial(leadingCoefficient f,makeprod(0,degree f))$newPoly + + npoly(reductum f) + + oldpoly(q:newPoly) : Union(DPoly,"failed") == + q=0$newPoly => 0$DPoly + dq:newExpon:=degree q + n:NNI:=selectfirst (dq) + n^=0 => "failed" + ((g:=oldpoly reductum q) case "failed") => "failed" + monomial(leadingCoefficient q,selectsecond dq)$DPoly + (g::DPoly) + + leadterm(f:DPoly,lvar:List VarSet) : DPoly == + empty?(lf:=variables f) or lf=lvar => f + leadterm(leadingCoefficient univariate(f,lf.first),lvar) + + choosel(f:DPoly,g:DPoly) : DPoly == + g=0 => f + (f1:=f exquo g) case "failed" => f + choosel(f1::DPoly,g) + + contractGrob(I1:newIdeal) : Ideal == + J1:List(newPoly):=groebner(I1) + while (oldpoly J1.first) case "failed" repeat J1:=J1.rest + [[(oldpoly f)::DPoly for f in J1],true] + + makeleast(fullVars: List VarSet,leastVars:List VarSet) : List VarSet == + n:= # leastVars + #fullVars < n => error "wrong vars" + n=0 => fullVars + append([vv for vv in fullVars| ^member?(vv,leastVars)],leastVars) + + isMonic?(f:DPoly,x:VarSet) : Boolean == + ground? leadingCoefficient univariate(f,x) + + subset(lv : List VarSet) : List List VarSet == + #lv =1 => [lv,empty()] + v:=lv.1 + ll:=subset(rest lv) + l1:=[concat(v,set) for set in ll] + concat(l1,ll) + + monomDim(listm:Ideal,lv:List VarSet) : NNI == + monvar: List List VarSet := [] + for f in generators listm repeat + mvset := variables f + #mvset > 1 => monvar:=concat(mvset,monvar) + lv:=delete(lv,position(mvset.1,lv)) + empty? lv => 0 + lsubset : List List VarSet := sort(#(#1)>#(#2),subset(lv)) + for subs in lsubset repeat + ldif:List VarSet:= lv + for mvset in monvar while ldif ^=[] repeat + ldif:=setDifference(mvset,subs) + if ^(empty? ldif) then return #subs + 0 + + -- Exported Functions ---- + + ---- is I = J ? ---- + (I:Ideal = J:Ideal) == in?(I,J) and in?(J,I) + + ---- check if f is in I ---- + element?(f:DPoly,I:Ideal) : Boolean == + Id:=(groebner I).idl + empty? Id => f = 0 + normalForm(f,Id) = 0 + + ---- check if I is contained in J ---- + in?(I:Ideal,J:Ideal):Boolean == + J:= groebner J + empty?(I.idl) => true + "and"/[element?(f,J) for f in I.idl ] + + + ---- groebner base for an Ideal ---- + groebner(I:Ideal) : Ideal == + I.isGr => + "or"/[^zero? f for f in I.idl] => I + [empty(),true] + [groebner I.idl ,true] + + ---- Intersection of two ideals ---- + intersect(I:Ideal,J:Ideal) : Ideal == + empty?(Id:=I.idl) => I + empty?(Jd:=J.idl) => J + tp:newPoly := monomial(1,makeprod(1,0$Expon))$newPoly + tp1:newPoly:= tp-1 + contractGrob(concat([tp*npoly f for f in Id], + [tp1*npoly f for f in Jd])) + + + ---- intersection for a list of ideals ---- + + intersect(lid:List(Ideal)) : Ideal == "intersect"/[l for l in lid] + + ---- quotient by an element ---- + quotient(I:Ideal,f:DPoly) : Ideal == + --[[(g exquo f)::DPoly for g in (intersect(I,[f]::%)).idl ],true] + import GroebnerInternalPackage(F,Expon,VarSet,DPoly) + [minGbasis [(g exquo f)::DPoly + for g in (intersect(I,[f]::%)).idl ],true] + + ---- quotient of two ideals ---- + quotient(I:Ideal,J:Ideal) : Ideal == + Jdl := J.idl + empty?(Jdl) => ideal [1] + [("intersect"/[quotient(I,f) for f in Jdl ]).idl ,true] + + + ---- sum of two ideals ---- + (I:Ideal + J:Ideal) : Ideal == [groebner(concat(I.idl ,J.idl )),true] + + ---- product of two ideals ---- + (I:Ideal * J:Ideal):Ideal == + [groebner([:[f*g for f in I.idl ] for g in J.idl ]),true] + + ---- power of an ideal ---- + (I:Ideal ** n:NNI) : Ideal == + n=0 => [[1$DPoly],true] + (I * (I**(n-1):NNI)) + + ---- saturation with respect to the multiplicative set f**n ---- + saturate(I:Ideal,f:DPoly) : Ideal == + f=0 => error "f is zero" + tp:newPoly := (monomial(1,makeprod(1,0$Expon))$newPoly * npoly f)-1 + contractGrob(concat(tp,[npoly g for g in I.idl ])) + + ---- saturation with respect to a prime principal ideal in lvar --- + saturate(I:Ideal,f:DPoly,lvar:List(VarSet)) : Ideal == + Id := I.idl + fullVars := "setUnion"/[variables g for g in Id] + newVars:=makeleast(fullVars,lvar) + subVars := [monomial(1,vv,1) for vv in newVars] + J:List DPoly:=groebner([eval(g,fullVars,subVars) for g in Id]) + ltJ:=[leadterm(g,lvar) for g in J] + s:DPoly:=_*/[choosel(ltg,f) for ltg in ltJ] + fullPol:=[monomial(1,vv,1) for vv in fullVars] + [[eval(g,newVars,fullPol) for g in (saturate(J::%,s)).idl],true] + + ---- is the ideal zero dimensional? ---- + ---- in the ring F[lvar]? ---- + zeroDim?(I:Ideal,lvar:List VarSet) : Boolean == + J:=(groebner I).idl + empty? J => false + J = [1] => false + n:NNI := # lvar + #J < n => false + for f in J while ^empty?(lvar) repeat + x:=(mainVariable f)::VarSet + if isMonic?(f,x) then lvar:=delete(lvar,position(x,lvar)) + empty?(lvar) + + ---- is the ideal zero dimensional? ---- + zeroDim?(I:Ideal):Boolean == zeroDim?(I,"setUnion"/[variables g for g in I.idl]) + + ---- test if f is in the radical of I ---- + inRadical?(f:DPoly,I:Ideal) : Boolean == + f=0$DPoly => true + tp:newPoly :=(monomial(1,makeprod(1,0$Expon))$newPoly * npoly f)-1 + Id:=I.idl + normalForm(1$newPoly,groebner concat(tp,[npoly g for g in Id])) = 0 + + ---- dimension of an ideal ---- + ---- in the ring F[lvar] ---- + dimension(I:Ideal,lvar:List VarSet) : Z == + I:=groebner I + empty?(I.idl) => # lvar + element?(1,I) => -1 + truelist:="setUnion"/[variables f for f in I.idl] + "or"/[^member?(vv,lvar) for vv in truelist] => error "wrong variables" + truelist:=setDifference(lvar,setDifference(lvar,truelist)) + ed:Z:=#lvar - #truelist + leadid:=leadingIdeal(I) + n1:Z:=monomDim(leadid,truelist)::Z + ed+n1 + + dimension(I:Ideal) : Z == dimension(I,"setUnion"/[variables g for g in I.idl]) + + -- leading term ideal -- + leadingIdeal(I : Ideal) : Ideal == + Idl:= (groebner I).idl + [[(f-reductum f) for f in Idl],true] + + ---- ideal of relations among the fi ---- + if VarSet has ConvertibleTo Symbol then + + monompol(df:List NNI,lcf:F,lv:List VarSet) : P == + g:P:=lcf::P + for dd in df for v in lv repeat + g:= monomial(g,convert v,dd) + g + + relationsIdeal(listf : List DPoly): ST == + empty? listf => [empty(),empty()]$ST + nf:=#listf + lvint := "setUnion"/[variables g for g in listf] + vl: List Symbol := [convert vv for vv in lvint] + nvar:List Symbol:=[new() for i in 1..nf] + VarSet1:=OrderedVariableList(concat(vl,nvar)) + lv1:=[variable(vv)$VarSet1::VarSet1 for vv in nvar] + DirP:=DirectProduct(nf,NNI) + nExponent:=Product(Expon,DirP) + nPoly := PolynomialRing(F,nExponent) + gp:=GroebnerPackage(F,nExponent,VarSet1,nPoly) + lf:List nPoly :=[] + lp:List P:=[] + for f in listf for i in 1.. repeat + vec2:Vector(NNI):=new(nf,0$NNI) + vec2.i:=1 + g:nPoly:=0$nPoly + pol:=0$P + while f^=0 repeat + df:=degree(f-reductum f,lvint) + lcf:=leadingCoefficient f + pol:=pol+monompol(df,lcf,lvint) + g:=g+monomial(lcf,makeprod(degree f,0))$nPoly + f:=reductum f + lp:=concat(pol,lp) + lf:=concat(monomial(1,makeprod(0,directProduct vec2))-g,lf) + npol:List P :=[v::P for v in nvar] + leq : List Equation P := + [p = pol for p in npol for pol in reverse lp ] + lf:=(groebner lf)$gp + while lf^=[] repeat + q:=lf.first + dq:nExponent:=degree q + n:=selectfirst (dq) + if n=0 then leave "done" + lf:=lf.rest + solsn:List P:=[] + for q in lf repeat + g:Polynomial F :=0 + while q^=0 repeat + dq:=degree q + lcq:=leadingCoefficient q + q:=reductum q + vdq:=(selectsecond dq):Vector NNI + g:=g+ lcq* + _*/[p**vdq.j for p in npol for j in 1..] + solsn:=concat(g,solsn) + [solsn,leq]$ST + + coerce(Id:List DPoly) : Ideal == [Id,false] + + coerce(I:Ideal) : OutputForm == + Idl := I.idl + empty? Idl => [0$DPoly] :: OutputForm + Idl :: OutputForm + + ideal(Id:List DPoly) :Ideal == [[f for f in Id|f^=0],false] + + groebnerIdeal(Id:List DPoly) : Ideal == [Id,true] + + generators(I:Ideal) : List DPoly == I.idl + + groebner?(I:Ideal) : Boolean == I.isGr + + one?(I:Ideal) : Boolean == element?(1, I) + + zero?(I:Ideal) : Boolean == empty? (groebner I).idl - p2f p == - map(#1::Float, p)$SparseUnivariatePolynomialFunctions2( - Integer, Float) (pi()$Float) +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain PI PositiveInteger} +\pagehead{PositiveInteger}{PI} +\pagepic{ps/v103positiveinteger.ps}{PI}{1.00} +See also:\\ +\refto{Integer}{INT} +\refto{NonNegativeInteger}{NNI} +\refto{RomanNumeral}{ROMAN} +<>= +)abbrev domain PI PositiveInteger +++ Author: +++ Date Created: +++ Change History: +++ Basic Operations: +++ Related Constructors: +++ Keywords: positive integer +++ Description: \spadtype{PositiveInteger} provides functions for +++ positive integers. +PositiveInteger: Join(AbelianSemiGroup,OrderedSet,Monoid) with + gcd: (%,%) -> % + ++ gcd(a,b) computes the greatest common divisor of two + ++ positive integers \spad{a} and b. + commutative("*") + ++ commutative("*") means multiplication is commutative : x*y = y*x + == SubDomain(NonNegativeInteger,#1 > 0) add + x:% + y:% @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -31290,6 +37495,336 @@ digraph pic { } @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain ROMAN RomanNumeral} +<>= +-- integer.spad.pamphlet RomanNumeral.input +)spool RomanNumeral.output +)set message test on +)set message auto off +)clear all +--S 1 of 15 +f := operator 'f +--R +--R +--R (1) f +--R Type: BasicOperator +--E 1 + +--S 2 of 15 +D(f x,x,7) +--R +--R +--R (vii) +--R (2) f (x) +--R +--R Type: Expression Integer +--E 2 + +--S 3 of 15 +a := roman(1978 - 1965) +--R +--R +--R (3) XIII +--R Type: RomanNumeral +--E 3 + +--S 4 of 15 +x : UTS(ROMAN,'x,0) := x +--R +--R +--R (4) x +--R Type: UnivariateTaylorSeries(RomanNumeral,x,0) +--E 4 + +--S 5 of 15 +recip(1 - x - x**2) +--R +--R +--R (5) +--R 2 3 4 5 6 7 8 +--R I + x + II x + III x + V x + VIII x + XIII x + XXI x + XXXIV x +--R + +--R 9 10 11 +--R LV x + LXXXIX x + O(x ) +--R Type: Union(UnivariateTaylorSeries(RomanNumeral,x,0),...) +--E 5 + +--S 6 of 15 +m : MATRIX FRAC ROMAN +--R +--R Type: Void +--E 6 + +--S 7 of 15 +m := matrix [ [1/(i + j) for i in 1..3] for j in 1..3] +--R +--R +--R + I I I+ +--R |-- --- --| +--R |II III IV| +--R | | +--R | I I I | +--R (7) |--- -- - | +--R |III IV V | +--R | | +--R | I I I| +--R |-- - --| +--R +IV V VI+ +--R Type: Matrix Fraction RomanNumeral +--E 7 + +--S 8 of 15 +inverse m +--R +--R +--R +LXXII - CCXL CLXXX + +--R | | +--R (8) |- CCXL CM - DCCXX| +--R | | +--R +CLXXX - DCCXX DC + +--R Type: Union(Matrix Fraction RomanNumeral,...) +--E 8 + +--S 9 of 15 +y := factorial 10 +--R +--R +--R (9) 3628800 +--R Type: PositiveInteger +--E 9 + +--S 10 of 15 +roman y +--R +--R +--R (10) +--R ((((I))))((((I))))((((I)))) (((I)))(((I)))(((I)))(((I)))(((I)))(((I))) ((I))( +--R (I)) MMMMMMMMDCCC +--R Type: RomanNumeral +--E 10 + +--S 11 of 15 +a := roman(78) +--R +--R +--R (11) LXXVIII +--R Type: RomanNumeral +--E 11 + +--S 12 of 15 +b := roman(87) +--R +--R +--R (12) LXXXVII +--R Type: RomanNumeral +--E 12 + +--S 13 of 15 +a + b +--R +--R +--R (13) CLXV +--R Type: RomanNumeral +--E 13 + +--S 14 of 15 +a * b +--R +--R +--R (14) MMMMMMDCCLXXXVI +--R Type: RomanNumeral +--E 14 + +--S 15 of 15 +b rem a +--R +--R +--R (15) IX +--R Type: RomanNumeral +--E 15 +)spool +)lisp (bye) +@ +<>= +==================================================================== +RomanNumeral Examples +==================================================================== + +The Roman numeral package was added to Axiom in MCMLXXXVI for use in +denoting higher order derivatives. + +For example, let f be a symbolic operator. + + f := operator 'f + f + Type: BasicOperator + +This is the seventh derivative of f with respect to x. + D(f x,x,7) + (vii) + f (x) + Type: Expression Integer + +You can have integers printed as Roman numerals by declaring variables to +be of type RomanNumeral (abbreviation ROMAN). + + a := roman(1978 - 1965) + XIII + Type: RomanNumeral + +This package now has a small but devoted group of followers that claim +this domain has shown its efficacy in many other contexts. They claim +that Roman numerals are every bit as useful as ordinary integers. + +In a sense, they are correct, because Roman numerals form a ring and you +can therefore construct polynomials with Roman numeral coefficients, +matrices over Roman numerals, etc.. + + x : UTS(ROMAN,'x,0) := x + x + Type: UnivariateTaylorSeries(RomanNumeral,x,0) + +Was Fibonacci Italian or ROMAN? + + recip(1 - x - x**2) + 2 3 4 5 6 7 8 + I + x + II x + III x + V x + VIII x + XIII x + XXI x + XXXIV x + + + 9 10 11 + LV x + LXXXIX x + O(x ) + Type: Union(UnivariateTaylorSeries(RomanNumeral,x,0),...) + +You can also construct fractions with Roman numeral numerators and +denominators, as this matrix Hilberticus illustrates. + + m : MATRIX FRAC ROMAN + Type: Void + + m := matrix [ [1/(i + j) for i in 1..3] for j in 1..3] + + I I I+ + |-- --- --| + |II III IV| + | | + | I I I | + |--- -- - | + |III IV V | + | | + | I I I| + |-- - --| + +IV V VI+ + Type: Matrix Fraction RomanNumeral + +Note that the inverse of the matrix has integral ROMAN entries. + + inverse m + +LXXII - CCXL CLXXX + + | | + |- CCXL CM - DCCXX| + | | + +CLXXX - DCCXX DC + + Type: Union(Matrix Fraction RomanNumeral,...) + +Unfortunately, the spoil-sports say that the fun stops when the +numbers get big---mostly because the Romans didn't establish +conventions about representing very large numbers. + + y := factorial 10 + 3628800 + Type: PositiveInteger + +You work it out! + + roman y + ((((I))))((((I))))((((I)))) (((I)))(((I)))(((I)))(((I)))(((I)))(((I))) ((I))( + (I)) MMMMMMMMDCCC + Type: RomanNumeral + +Issue the system command )show RomanNumeral to display the full +list of operations defined by RomanNumeral. + + + a := roman(78) + LXXVIII + Type: RomanNumeral + + b := roman(87) + LXXXVII + Type: RomanNumeral + + a + b + CLXV + Type: RomanNumeral + + a * b + MMMMMMDCCLXXXVI + Type: RomanNumeral + + b rem a + IX + Type: RomanNumeral + +See Also: +o )help Integer +o )help Complex +o )help Factored +o )help Records +o )help Fraction +o )help RadixExpansion +o )help HexadecimalExpansion +o )help BinaryExpansion +o )help DecimalExpansion +o )help IntegerNumberTheoryFunctions +o )show RomanNumeral +o $AXIOM/doc/src/algebra/integer.spad.dvi + +@ +\pagehead{RomanNumeral}{ROMAN} +\pagepic{ps/v103romannumeral.ps}{ROMAN}{1.00} +See also:\\ +\refto{Integer}{INT} +\refto{NonNegativeInteger}{NNI} +\refto{PositiveInteger}{PI} +<>= +)abbrev domain ROMAN RomanNumeral +++ Author: +++ Date Created: +++ Change History: +++ Basic Operations: +++ convert, roman +++ Related Constructors: +++ Keywords: roman numerals +++ Description: \spadtype{RomanNumeral} provides functions for converting +++ integers to roman numerals. +RomanNumeral(): IntegerNumberSystem with + canonical + ++ mathematical equality is data structure equality. + canonicalsClosed + ++ two positives multiply to give positive. + noetherian + ++ ascending chain condition on ideals. + convert: Symbol -> % + ++ convert(n) creates a roman numeral for symbol n. + roman : Symbol -> % + ++ roman(n) creates a roman numeral for symbol n. + roman : Integer -> % + ++ roman(n) creates a roman numeral for n. + + == Integer add + import NumberFormats() + + roman(n:Integer) == n::% + roman(sy:Symbol) == convert sy + convert(sy:Symbol):% == ScanRoman(string sy)::% + + coerce(r:%):OutputForm == + n := convert(r)@Integer + -- okay, we stretch it + zero? n => n::OutputForm + negative? n => - ((-r)::OutputForm) + FormatRoman(n::PositiveInteger)::Symbol::OutputForm + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Chapter S} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain FORMULA ScriptFormulaFormat} @@ -32080,6 +38615,62 @@ SimpleFortranProgram(R,FS): Exports == Implementation where @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain SHDP SplitHomogeneousDirectProduct} +\pagehead{SplitHomogeneousDirectProduct}{SHDP} +\pagepic{ps/v103splithomogeneousdirectproduct.ps}{SHDP}{1.00} +See also:\\ +\refto{OrderedDirectProduct}{ODP} +\refto{HomogeneousDirectProduct}{HDP} +<>= +)abbrev domain SHDP SplitHomogeneousDirectProduct +++ Author: +++ Date Created: +++ Date Last Updated: +++ Basic Functions: +++ Related Constructors: Vector, DirectProduct +++ Also See: OrderedDirectProduct, HomogeneousDirectProduct +++ AMS Classifications: +++ Keywords: +++ References: +++ Description: +++ This type represents the finite direct or cartesian product of an +++ underlying ordered component type. The vectors are ordered as if +++ they were split into two blocks. The dim1 parameter specifies the +++ length of the first block. The ordering is lexicographic between +++ the blocks but acts like \spadtype{HomogeneousDirectProduct} +++ within each block. This type is a suitable third argument for +++ \spadtype{GeneralDistributedMultivariatePolynomial}. + +SplitHomogeneousDirectProduct(dimtot,dim1,S) : T == C where + NNI ==> NonNegativeInteger + dim1,dimtot : NNI + S : OrderedAbelianMonoidSup + + T == DirectProductCategory(dimtot,S) + C == DirectProduct(dimtot,S) add + Rep:=Vector(S) + lessThanRlex(v1:%,v2:%,low:NNI,high:NNI):Boolean == + -- reverse lexicographical ordering + n1:S:=0 + n2:S:=0 + for i in low..high repeat + n1:= n1+qelt(v1,i) + n2:=n2+qelt(v2,i) + n1 true + n2 false + for i in reverse(low..high) repeat + if qelt(v2,i) < qelt(v1,i) then return true + if qelt(v1,i) < qelt(v2,i) then return false + false + + (v1:% < v2:%):Boolean == + lessThanRlex(v1,v2,1,dim1) => true + for i in 1..dim1 repeat + if qelt(v1,i) ^= qelt(v2,i) then return false + lessThanRlex(v1,v2,dim1+1,dimtot) + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain STACK Stack} <>= "STACK" -> "SKAGG" @@ -33704,6 +40295,522 @@ TwoDimensionalArray(R):Exports == Implementation where %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Chapter U} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain ULS UnivariateLaurentSeries} +\pagehead{UnivariateLaurentSeries}{ULS} +\pagepic{ps/v103univariatelaurentseries.ps}{ULS}{1.00} +See also:\\ +\refto{UnivariateLaurentSeriesConstructor}{ULSCONS} +<>= +)abbrev domain ULS UnivariateLaurentSeries +++ Author: Clifton J. Williamson +++ Date Created: 18 January 1990 +++ Date Last Updated: 21 September 1993 +++ Basic Operations: +++ Related Domains: +++ Also See: +++ AMS Classifications: +++ Keywords: series, Laurent +++ Examples: +++ References: +++ Description: Dense Laurent series in one variable +++ \spadtype{UnivariateLaurentSeries} is a domain representing Laurent +++ series in one variable with coefficients in an arbitrary ring. The +++ parameters of the type specify the coefficient ring, the power series +++ variable, and the center of the power series expansion. For example, +++ \spad{UnivariateLaurentSeries(Integer,x,3)} represents Laurent series in +++ \spad{(x - 3)} with integer coefficients. +UnivariateLaurentSeries(Coef,var,cen): Exports == Implementation where + Coef : Ring + var : Symbol + cen : Coef + I ==> Integer + UTS ==> UnivariateTaylorSeries(Coef,var,cen) + + Exports ==> UnivariateLaurentSeriesConstructorCategory(Coef,UTS) with + coerce: Variable(var) -> % + ++ \spad{coerce(var)} converts the series variable \spad{var} into a + ++ Laurent series. + differentiate: (%,Variable(var)) -> % + ++ \spad{differentiate(f(x),x)} returns the derivative of + ++ \spad{f(x)} with respect to \spad{x}. + if Coef has Algebra Fraction Integer then + integrate: (%,Variable(var)) -> % + ++ \spad{integrate(f(x))} returns an anti-derivative of the power + ++ series \spad{f(x)} with constant coefficient 0. + ++ We may integrate a series when we can divide coefficients + ++ by integers. + + Implementation ==> UnivariateLaurentSeriesConstructor(Coef,UTS) add + + variable x == var + center x == cen + + coerce(v:Variable(var)) == + zero? cen => monomial(1,1) + monomial(1,1) + monomial(cen,0) + + differentiate(x:%,v:Variable(var)) == differentiate x + + if Coef has Algebra Fraction Integer then + integrate(x:%,v:Variable(var)) == integrate x + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain ULSCONS UnivariateLaurentSeriesConstructor} +\pagehead{UnivariateLaurentSeriesConstructor}{ULSCONS} +\pagepic{ps/v103univariatelaurentseriesconstructor.ps}{ULSCONS}{1.00} +See also:\\ +\refto{UnivariateLaurentSeries}{ULS} +<>= +)abbrev domain ULSCONS UnivariateLaurentSeriesConstructor +++ Authors: Bill Burge, Clifton J. Williamson +++ Date Created: August 1988 +++ Date Last Updated: 17 June 1996 +++ Fix History: +++ 14 June 1996: provided missing exquo: (%,%) -> % (Frederic Lehobey) +++ Basic Operations: +++ Related Domains: +++ Also See: +++ AMS Classifications: +++ Keywords: series, Laurent, Taylor +++ Examples: +++ References: +++ Description: +++ This package enables one to construct a univariate Laurent series +++ domain from a univariate Taylor series domain. Univariate +++ Laurent series are represented by a pair \spad{[n,f(x)]}, where n is +++ an arbitrary integer and \spad{f(x)} is a Taylor series. This pair +++ represents the Laurent series \spad{x**n * f(x)}. +UnivariateLaurentSeriesConstructor(Coef,UTS):_ + Exports == Implementation where + Coef : Ring + UTS : UnivariateTaylorSeriesCategory Coef + I ==> Integer + L ==> List + NNI ==> NonNegativeInteger + OUT ==> OutputForm + P ==> Polynomial Coef + RF ==> Fraction Polynomial Coef + RN ==> Fraction Integer + ST ==> Stream Coef + TERM ==> Record(k:I,c:Coef) + monom ==> monomial$UTS + EFULS ==> ElementaryFunctionsUnivariateLaurentSeries(Coef,UTS,%) + STTAYLOR ==> StreamTaylorSeriesOperations Coef + + Exports ==> UnivariateLaurentSeriesConstructorCategory(Coef,UTS) + + Implementation ==> add + +--% representation + + Rep := Record(expon:I,ps:UTS) + + getExpon : % -> I + getUTS : % -> UTS + + getExpon x == x.expon + getUTS x == x.ps + +--% creation and destruction + + laurent(n,psr) == [n,psr] + taylorRep x == getUTS x + degree x == getExpon x + + 0 == laurent(0,0) + 1 == laurent(0,1) + + monomial(s,e) == laurent(e,s::UTS) + + coerce(uts:UTS):% == laurent(0,uts) + coerce(r:Coef):% == r :: UTS :: % + coerce(i:I):% == i :: Coef :: % + + taylorIfCan uls == + n := getExpon uls + n < 0 => + uls := removeZeroes(-n,uls) + getExpon(uls) < 0 => "failed" + getUTS uls + n = 0 => getUTS uls + getUTS(uls) * monom(1,n :: NNI) + + taylor uls == + (uts := taylorIfCan uls) case "failed" => + error "taylor: Laurent series has a pole" + uts :: UTS + + termExpon: TERM -> I + termExpon term == term.k + termCoef: TERM -> Coef + termCoef term == term.c + rec: (I,Coef) -> TERM + rec(exponent,coef) == [exponent,coef] + + recs: (ST,I) -> Stream TERM + recs(st,n) == delay + empty? st => empty() + zero? (coef := frst st) => recs(rst st,n + 1) + concat(rec(n,coef),recs(rst st,n + 1)) + + terms x == recs(coefficients getUTS x,getExpon x) + + recsToCoefs: (Stream TERM,I) -> ST + recsToCoefs(st,n) == delay + empty? st => empty() + term := frst st; ex := termExpon term + n = ex => concat(termCoef term,recsToCoefs(rst st,n + 1)) + concat(0,recsToCoefs(rst st,n + 1)) + + series st == + empty? st => 0 + ex := termExpon frst st + laurent(ex,series recsToCoefs(st,ex)) + +--% normalizations + + removeZeroes x == + empty? coefficients(xUTS := getUTS x) => 0 + coefficient(xUTS,0) = 0 => + removeZeroes laurent(getExpon(x) + 1,quoByVar xUTS) + x + + removeZeroes(n,x) == + n <= 0 => x + empty? coefficients(xUTS := getUTS x) => 0 + coefficient(xUTS,0) = 0 => + removeZeroes(n - 1,laurent(getExpon(x) + 1,quoByVar xUTS)) + x + +--% predicates + + x = y == + EQ(x,y)$Lisp => true + (expDiff := getExpon(x) - getExpon(y)) = 0 => + getUTS(x) = getUTS(y) + abs(expDiff) > _$streamCount$Lisp => false + expDiff > 0 => + getUTS(x) * monom(1,expDiff :: NNI) = getUTS(y) + getUTS(y) * monom(1,(- expDiff) :: NNI) = getUTS(x) + + pole? x == + (n := degree x) >= 0 => false + x := removeZeroes(-n,x) + degree x < 0 + +--% arithmetic + + x + y == + n := getExpon(x) - getExpon(y) + n >= 0 => + laurent(getExpon y,getUTS(y) + getUTS(x) * monom(1,n::NNI)) + laurent(getExpon x,getUTS(x) + getUTS(y) * monom(1,(-n)::NNI)) + + x - y == + n := getExpon(x) - getExpon(y) + n >= 0 => + laurent(getExpon y,getUTS(x) * monom(1,n::NNI) - getUTS(y)) + laurent(getExpon x,getUTS(x) - getUTS(y) * monom(1,(-n)::NNI)) + + x:% * y:% == laurent(getExpon x + getExpon y,getUTS x * getUTS y) + + x:% ** n:NNI == + zero? n => + zero? x => error "0 ** 0 is undefined" + 1 + laurent(n * getExpon(x),getUTS(x) ** n) + + recip x == + x := removeZeroes(1000,x) + zero? coefficient(x,d := degree x) => "failed" + (uts := recip getUTS x) case "failed" => "failed" + laurent(-d,uts :: UTS) + + elt(uls1:%,uls2:%) == + (uts := taylorIfCan uls2) case "failed" => + error "elt: second argument must have positive order" + uts2 := uts :: UTS + not zero? coefficient(uts2,0) => + error "elt: second argument must have positive order" + if (deg := getExpon uls1) < 0 then uls1 := removeZeroes(-deg,uls1) + (deg := getExpon uls1) < 0 => + (recipr := recip(uts2 :: %)) case "failed" => + error "elt: second argument not invertible" + uts1 := taylor(uls1 * monomial(1,-deg)) + (elt(uts1,uts2) :: %) * (recipr :: %) ** ((-deg) :: NNI) + elt(taylor uls1,uts2) :: % + + eval(uls:%,r:Coef) == + if (n := getExpon uls) < 0 then uls := removeZeroes(-n,uls) + uts := getUTS uls + (n := getExpon uls) < 0 => + zero? r => error "eval: 0 raised to negative power" + (recipr := recip r) case "failed" => + error "eval: non-unit raised to negative power" + (recipr :: Coef) ** ((-n) :: NNI) *$STTAYLOR eval(uts,r) + zero? n => eval(uts,r) + r ** (n :: NNI) *$STTAYLOR eval(uts,r) + +--% values + + variable x == variable getUTS x + center x == center getUTS x + + coefficient(x,n) == + a := n - getExpon(x) + a >= 0 => coefficient(getUTS x,a :: NNI) + 0 + + elt(x:%,n:I) == coefficient(x,n) + +--% other functions + + order x == getExpon x + order getUTS x + order(x,n) == + (m := n - (e := getExpon x)) < 0 => n + e + order(getUTS x,m :: NNI) + + truncate(x,n) == + (m := n - (e := getExpon x)) < 0 => 0 + laurent(e,truncate(getUTS x,m :: NNI)) + + truncate(x,n1,n2) == + if n2 < n1 then (n1,n2) := (n2,n1) + (m1 := n1 - (e := getExpon x)) < 0 => truncate(x,n2) + laurent(e,truncate(getUTS x,m1 :: NNI,(n2 - e) :: NNI)) + + if Coef has IntegralDomain then + rationalFunction(x,n) == + (m := n - (e := getExpon x)) < 0 => 0 + poly := polynomial(getUTS x,m :: NNI) :: RF + zero? e => poly + v := variable(x) :: RF; c := center(x) :: P :: RF + positive? e => poly * (v - c) ** (e :: NNI) + poly / (v - c) ** ((-e) :: NNI) + + rationalFunction(x,n1,n2) == + if n2 < n1 then (n1,n2) := (n2,n1) + (m1 := n1 - (e := getExpon x)) < 0 => rationalFunction(x,n2) + poly := polynomial(getUTS x,m1 :: NNI,(n2 - e) :: NNI) :: RF + zero? e => poly + v := variable(x) :: RF; c := center(x) :: P :: RF + positive? e => poly * (v - c) ** (e :: NNI) + poly / (v - c) ** ((-e) :: NNI) + + -- La fonction < exquo > manque dans laurent.spad, + --les lignes suivantes le mettent en evidence : + -- + --ls := laurent(0,series [i for i in 1..])$ULS(INT,x,0) + ---- missing function in laurent.spad of Axiom 2.0a version of + ---- Friday March 10, 1995 at 04:15:22 on 615: + --exquo(ls,ls) + -- + -- Je l'ai ajoutee a laurent.spad. + -- + --Frederic Lehobey + x exquo y == + x := removeZeroes(1000,x) + y := removeZeroes(1000,y) + zero? coefficient(y, d := degree y) => "failed" + (uts := (getUTS x) exquo (getUTS y)) case "failed" => "failed" + laurent(degree x-d,uts :: UTS) + + if Coef has coerce: Symbol -> Coef then + if Coef has "**": (Coef,I) -> Coef then + + approximate(x,n) == + (m := n - (e := getExpon x)) < 0 => 0 + app := approximate(getUTS x,m :: NNI) + zero? e => app + app * ((variable(x) :: Coef) - center(x)) ** e + + complete x == laurent(getExpon x,complete getUTS x) + extend(x,n) == + e := getExpon x + (m := n - e) < 0 => x + laurent(e,extend(getUTS x,m :: NNI)) + + map(f:Coef -> Coef,x:%) == laurent(getExpon x,map(f,getUTS x)) + + multiplyCoefficients(f,x) == + e := getExpon x + laurent(e,multiplyCoefficients(f(e + #1),getUTS x)) + + multiplyExponents(x,n) == + laurent(n * getExpon x,multiplyExponents(getUTS x,n)) + + differentiate x == + e := getExpon x + laurent(e - 1,multiplyCoefficients((e + #1) :: Coef,getUTS x)) + + if Coef has PartialDifferentialRing(Symbol) then + differentiate(x:%,s:Symbol) == + (s = variable(x)) => differentiate x + map(differentiate(#1,s),x) - differentiate(center x,s)*differentiate(x) + + characteristic() == characteristic()$Coef + + if Coef has Field then + + retract(x:%):UTS == taylor x + retractIfCan(x:%):Union(UTS,"failed") == taylorIfCan x + + (x:%) ** (n:I) == + zero? n => + zero? x => error "0 ** 0 is undefined" + 1 + n > 0 => laurent(n * getExpon(x),getUTS(x) ** (n :: NNI)) + xInv := inv x; minusN := (-n) :: NNI + laurent(minusN * getExpon(xInv),getUTS(xInv) ** minusN) + + (x:UTS) * (y:%) == (x :: %) * y + (x:%) * (y:UTS) == x * (y :: %) + + inv x == + (xInv := recip x) case "failed" => + error "multiplicative inverse does not exist" + xInv :: % + + (x:%) / (y:%) == + (yInv := recip y) case "failed" => + error "inv: multiplicative inverse does not exist" + x * (yInv :: %) + + (x:UTS) / (y:UTS) == (x :: %) / (y :: %) + + numer x == + (n := degree x) >= 0 => taylor x + x := removeZeroes(-n,x) + (n := degree x) = 0 => taylor x + getUTS x + + denom x == + (n := degree x) >= 0 => 1 + x := removeZeroes(-n,x) + (n := degree x) = 0 => 1 + monom(1,(-n) :: NNI) + +--% algebraic and transcendental functions + + if Coef has Algebra Fraction Integer then + + coerce(r:RN) == r :: Coef :: % + + if Coef has Field then + (x:%) ** (r:RN) == x **$EFULS r + + exp x == exp(x)$EFULS + log x == log(x)$EFULS + sin x == sin(x)$EFULS + cos x == cos(x)$EFULS + tan x == tan(x)$EFULS + cot x == cot(x)$EFULS + sec x == sec(x)$EFULS + csc x == csc(x)$EFULS + asin x == asin(x)$EFULS + acos x == acos(x)$EFULS + atan x == atan(x)$EFULS + acot x == acot(x)$EFULS + asec x == asec(x)$EFULS + acsc x == acsc(x)$EFULS + sinh x == sinh(x)$EFULS + cosh x == cosh(x)$EFULS + tanh x == tanh(x)$EFULS + coth x == coth(x)$EFULS + sech x == sech(x)$EFULS + csch x == csch(x)$EFULS + asinh x == asinh(x)$EFULS + acosh x == acosh(x)$EFULS + atanh x == atanh(x)$EFULS + acoth x == acoth(x)$EFULS + asech x == asech(x)$EFULS + acsch x == acsch(x)$EFULS + + ratInv: I -> Coef + ratInv n == + zero? n => 1 + inv(n :: RN) :: Coef + + integrate x == + not zero? coefficient(x,-1) => + error "integrate: series has term of order -1" + e := getExpon x + laurent(e + 1,multiplyCoefficients(ratInv(e + 1 + #1),getUTS x)) + + if Coef has integrate: (Coef,Symbol) -> Coef and _ + Coef has variables: Coef -> List Symbol then + integrate(x:%,s:Symbol) == + (s = variable(x)) => integrate x + not entry?(s,variables center x) => map(integrate(#1,s),x) + error "integrate: center is a function of variable of integration" + + if Coef has TranscendentalFunctionCategory and _ + Coef has PrimitiveFunctionCategory and _ + Coef has AlgebraicallyClosedFunctionSpace Integer then + + integrateWithOneAnswer: (Coef,Symbol) -> Coef + integrateWithOneAnswer(f,s) == + res := integrate(f,s)$FunctionSpaceIntegration(I,Coef) + res case Coef => res :: Coef + first(res :: List Coef) + + integrate(x:%,s:Symbol) == + (s = variable(x)) => integrate x + not entry?(s,variables center x) => + map(integrateWithOneAnswer(#1,s),x) + error "integrate: center is a function of variable of integration" + + termOutput:(I,Coef,OUT) -> OUT + termOutput(k,c,vv) == + -- creates a term c * vv ** k + k = 0 => c :: OUT + mon := + k = 1 => vv + vv ** (k :: OUT) + c = 1 => mon + c = -1 => -mon + (c :: OUT) * mon + + showAll?:() -> Boolean + -- check a global Lisp variable + showAll?() == true + + termsToOutputForm:(I,ST,OUT) -> OUT + termsToOutputForm(m,uu,xxx) == + l : L OUT := empty() + empty? uu => (0$Coef) :: OUT + n : NNI ; count : NNI := _$streamCount$Lisp + for n in 0..count while not empty? uu repeat + if frst(uu) ^= 0 then + l := concat(termOutput((n :: I) + m,frst(uu),xxx),l) + uu := rst uu + if showAll?() then + for n in (count + 1).. while explicitEntries? uu and _ + not eq?(uu,rst uu) repeat + if frst(uu) ^= 0 then + l := concat(termOutput((n::I) + m,frst(uu),xxx),l) + uu := rst uu + l := + explicitlyEmpty? uu => l + eq?(uu,rst uu) and frst uu = 0 => l + concat(prefix("O" :: OUT,[xxx ** ((n :: I) + m) :: OUT]),l) + empty? l => (0$Coef) :: OUT + reduce("+",reverse_! l) + + coerce(x:%):OUT == + x := removeZeroes(_$streamCount$Lisp,x) + m := degree x + uts := getUTS x + p := coefficients uts + var := variable uts; cen := center uts + xxx := + zero? cen => var :: OUT + paren(var :: OUT - cen :: OUT) + termsToOutputForm(m,p,xxx) + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain UPXSSING UnivariatePuiseuxSeriesWithExponentialSingularity} \pagehead{UnivariatePuiseuxSeriesWithExponentialSingularity}{UPXSSING} \pagepic{ps/v103univariatepuiseuxserieswithexponentialsingularity.ps}{UPXSSING}{1.00} @@ -34265,6 +41372,1696 @@ This is eventually forcibly replaced by a recompiled version. @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{ILIST.lsp BOOTSTRAP} +{\bf ILIST} depends on a chain of +files. We need to break this cycle to build the algebra. So we keep a +cached copy of the translated {\bf ILIST} category which we can write +into the {\bf MID} directory. We compile the lisp code and copy the +{\bf ILIST.o} file to the {\bf OUT} directory. This is eventually +forcibly replaced by a recompiled version. + +Note that this code is not included in the generated catdef.spad file. + +<>= + +(|/VERSIONCHECK| 2) + +(PUT (QUOTE |ILIST;#;$Nni;1|) (QUOTE |SPADreplace|) (QUOTE LENGTH)) + +(DEFUN |ILIST;#;$Nni;1| (|x| |$|) (LENGTH |x|)) + +(PUT (QUOTE |ILIST;concat;S2$;2|) (QUOTE |SPADreplace|) (QUOTE CONS)) + +(DEFUN |ILIST;concat;S2$;2| (|s| |x| |$|) (CONS |s| |x|)) + +(PUT (QUOTE |ILIST;eq?;2$B;3|) (QUOTE |SPADreplace|) (QUOTE EQ)) + +(DEFUN |ILIST;eq?;2$B;3| (|x| |y| |$|) (EQ |x| |y|)) + +(PUT (QUOTE |ILIST;first;$S;4|) (QUOTE |SPADreplace|) (QUOTE |SPADfirst|)) + +(DEFUN |ILIST;first;$S;4| (|x| |$|) (|SPADfirst| |x|)) + +(PUT + (QUOTE |ILIST;elt;$firstS;5|) + (QUOTE |SPADreplace|) + (QUOTE (XLAM (|x| "first") (|SPADfirst| |x|)))) + +(DEFUN |ILIST;elt;$firstS;5| (|x| G101995 |$|) (|SPADfirst| |x|)) + +(PUT (QUOTE |ILIST;empty;$;6|) (QUOTE |SPADreplace|) (QUOTE (XLAM NIL NIL))) + +(DEFUN |ILIST;empty;$;6| (|$|) NIL) + +(PUT (QUOTE |ILIST;empty?;$B;7|) (QUOTE |SPADreplace|) (QUOTE NULL)) + +(DEFUN |ILIST;empty?;$B;7| (|x| |$|) (NULL |x|)) + +(PUT (QUOTE |ILIST;rest;2$;8|) (QUOTE |SPADreplace|) (QUOTE CDR)) + +(DEFUN |ILIST;rest;2$;8| (|x| |$|) (CDR |x|)) + +(PUT + (QUOTE |ILIST;elt;$rest$;9|) + (QUOTE |SPADreplace|) + (QUOTE (XLAM (|x| "rest") (CDR |x|)))) + +(DEFUN |ILIST;elt;$rest$;9| (|x| G102000 |$|) (CDR |x|)) + +(DEFUN |ILIST;setfirst!;$2S;10| (|x| |s| |$|) + (COND + ((SPADCALL |x| (QREFELT |$| 17)) (|error| "Cannot update an empty list")) + ((QUOTE T) (QCAR (RPLACA |x| |s|))))) + +(DEFUN |ILIST;setelt;$first2S;11| (|x| G102005 |s| |$|) + (COND + ((SPADCALL |x| (QREFELT |$| 17)) (|error| "Cannot update an empty list")) + ((QUOTE T) (QCAR (RPLACA |x| |s|))))) + +(DEFUN |ILIST;setrest!;3$;12| (|x| |y| |$|) + (COND + ((SPADCALL |x| (QREFELT |$| 17)) (|error| "Cannot update an empty list")) + ((QUOTE T) (QCDR (RPLACD |x| |y|))))) + +(DEFUN |ILIST;setelt;$rest2$;13| (|x| G102010 |y| |$|) + (COND + ((SPADCALL |x| (QREFELT |$| 17)) (|error| "Cannot update an empty list")) + ((QUOTE T) (QCDR (RPLACD |x| |y|))))) + +(PUT + (QUOTE |ILIST;construct;L$;14|) + (QUOTE |SPADreplace|) + (QUOTE (XLAM (|l|) |l|))) + +(DEFUN |ILIST;construct;L$;14| (|l| |$|) |l|) + +(PUT + (QUOTE |ILIST;parts;$L;15|) + (QUOTE |SPADreplace|) + (QUOTE (XLAM (|s|) |s|))) + +(DEFUN |ILIST;parts;$L;15| (|s| |$|) |s|) + +(PUT (QUOTE |ILIST;reverse!;2$;16|) (QUOTE |SPADreplace|) (QUOTE NREVERSE)) + +(DEFUN |ILIST;reverse!;2$;16| (|x| |$|) (NREVERSE |x|)) + +(PUT (QUOTE |ILIST;reverse;2$;17|) (QUOTE |SPADreplace|) (QUOTE REVERSE)) + +(DEFUN |ILIST;reverse;2$;17| (|x| |$|) (REVERSE |x|)) + +(DEFUN |ILIST;minIndex;$I;18| (|x| |$|) (QREFELT |$| 7)) + +(DEFUN |ILIST;rest;$Nni$;19| (|x| |n| |$|) + (PROG (|i|) + (RETURN + (SEQ + (SEQ + (LETT |i| 1 |ILIST;rest;$Nni$;19|) + G190 + (COND ((QSGREATERP |i| |n|) (GO G191))) + (SEQ + (COND ((NULL |x|) (|error| "index out of range"))) + (EXIT (LETT |x| (QCDR |x|) |ILIST;rest;$Nni$;19|))) + (LETT |i| (QSADD1 |i|) |ILIST;rest;$Nni$;19|) + (GO G190) + G191 + (EXIT NIL)) + (EXIT |x|))))) + +(DEFUN |ILIST;copy;2$;20| (|x| |$|) + (PROG (|i| |y|) + (RETURN + (SEQ + (LETT |y| (SPADCALL (QREFELT |$| 16)) |ILIST;copy;2$;20|) + (SEQ + (LETT |i| 0 |ILIST;copy;2$;20|) + G190 + (COND + ((NULL (COND ((NULL |x|) (QUOTE NIL)) ((QUOTE T) (QUOTE T)))) (GO G191))) + (SEQ + (COND + ((EQ |i| 1000) + (COND ((SPADCALL |x| (QREFELT |$| 33)) (|error| "cyclic list"))))) + (LETT |y| (CONS (QCAR |x|) |y|) |ILIST;copy;2$;20|) + (EXIT (LETT |x| (QCDR |x|) |ILIST;copy;2$;20|))) + (LETT |i| (QSADD1 |i|) |ILIST;copy;2$;20|) + (GO G190) + G191 + (EXIT NIL)) + (EXIT (NREVERSE |y|)))))) + +(DEFUN |ILIST;coerce;$Of;21| (|x| |$|) + (PROG (|s| |y| |z|) + (RETURN + (SEQ + (LETT |y| NIL |ILIST;coerce;$Of;21|) + (LETT |s| (SPADCALL |x| (QREFELT |$| 35)) |ILIST;coerce;$Of;21|) + (SEQ + G190 + (COND ((NULL (NEQ |x| |s|)) (GO G191))) + (SEQ + (LETT |y| + (CONS (SPADCALL (SPADCALL |x| (QREFELT |$| 13)) (QREFELT |$| 37)) |y|) + |ILIST;coerce;$Of;21|) + (EXIT (LETT |x| (SPADCALL |x| (QREFELT |$| 18)) |ILIST;coerce;$Of;21|))) + NIL + (GO G190) + G191 + (EXIT NIL)) + (LETT |y| (NREVERSE |y|) |ILIST;coerce;$Of;21|) + (EXIT + (COND + ((SPADCALL |s| (QREFELT |$| 17)) (SPADCALL |y| (QREFELT |$| 39))) + ((QUOTE T) + (SEQ + (LETT |z| + (SPADCALL + (SPADCALL (SPADCALL |x| (QREFELT |$| 13)) (QREFELT |$| 37)) + (QREFELT |$| 41)) + |ILIST;coerce;$Of;21|) + (SEQ + G190 + (COND ((NULL (NEQ |s| (SPADCALL |x| (QREFELT |$| 18)))) (GO G191))) + (SEQ + (LETT |x| (SPADCALL |x| (QREFELT |$| 18)) |ILIST;coerce;$Of;21|) + (EXIT + (LETT |z| + (CONS + (SPADCALL (SPADCALL |x| (QREFELT |$| 13)) (QREFELT |$| 37)) + |z|) + |ILIST;coerce;$Of;21|))) + NIL + (GO G190) + G191 + (EXIT NIL)) + (EXIT + (SPADCALL + (SPADCALL |y| + (SPADCALL + (SPADCALL + (NREVERSE |z|) + (QREFELT |$| 42)) + (QREFELT |$| 43)) + (QREFELT |$| 44)) + (QREFELT |$| 39))))))))))) + +(DEFUN |ILIST;=;2$B;22| (|x| |y| |$|) + (PROG (#1=#:G102042) + (RETURN + (SEQ + (EXIT + (COND + ((EQ |x| |y|) (QUOTE T)) + ((QUOTE T) + (SEQ + (SEQ + G190 + (COND + ((NULL + (COND + ((OR (NULL |x|) (NULL |y|)) (QUOTE NIL)) + ((QUOTE T) (QUOTE T)))) + (GO G191))) + (SEQ + (EXIT + (COND + ((NULL (SPADCALL (QCAR |x|) (QCAR |y|) (QREFELT |$| 46))) + (PROGN (LETT #1# (QUOTE NIL) |ILIST;=;2$B;22|) (GO #1#))) + ((QUOTE T) + (SEQ + (LETT |x| (QCDR |x|) |ILIST;=;2$B;22|) + (EXIT (LETT |y| (QCDR |y|) |ILIST;=;2$B;22|))))))) + NIL + (GO G190) + G191 + (EXIT NIL)) + (EXIT (COND ((NULL |x|) (NULL |y|)) ((QUOTE T) (QUOTE NIL)))))))) + #1# + (EXIT #1#))))) + +(DEFUN |ILIST;latex;$S;23| (|x| |$|) + (PROG (|s|) + (RETURN + (SEQ + (LETT |s| "\\left[" |ILIST;latex;$S;23|) + (SEQ + G190 + (COND + ((NULL (COND ((NULL |x|) (QUOTE NIL)) ((QUOTE T) (QUOTE T)))) + (GO G191))) + (SEQ + (LETT |s| + (STRCONC |s| (SPADCALL (QCAR |x|) (QREFELT |$| 49))) + |ILIST;latex;$S;23|) + (LETT |x| (QCDR |x|) |ILIST;latex;$S;23|) + (EXIT + (COND + ((NULL (NULL |x|)) + (LETT |s| (STRCONC |s| ", ") |ILIST;latex;$S;23|))))) + NIL + (GO G190) + G191 + (EXIT NIL)) + (EXIT (STRCONC |s| " \\right]")))))) + +(DEFUN |ILIST;member?;S$B;24| (|s| |x| |$|) + (PROG (#1=#:G102052) + (RETURN + (SEQ + (EXIT + (SEQ + (SEQ + G190 + (COND + ((NULL (COND ((NULL |x|) (QUOTE NIL)) ((QUOTE T) (QUOTE T)))) + (GO G191))) + (SEQ + (EXIT + (COND + ((SPADCALL |s| (QCAR |x|) (QREFELT |$| 46)) + (PROGN (LETT #1# (QUOTE T) |ILIST;member?;S$B;24|) (GO #1#))) + ((QUOTE T) (LETT |x| (QCDR |x|) |ILIST;member?;S$B;24|))))) + NIL + (GO G190) + G191 + (EXIT NIL)) + (EXIT (QUOTE NIL)))) + #1# + (EXIT #1#))))) + +(DEFUN |ILIST;concat!;3$;25| (|x| |y| |$|) + (PROG (|z|) + (RETURN + (SEQ + (COND + ((NULL |x|) + (COND + ((NULL |y|) |x|) + ((QUOTE T) + (SEQ + (PUSH (SPADCALL |y| (QREFELT |$| 13)) |x|) + (QRPLACD |x| (SPADCALL |y| (QREFELT |$| 18))) (EXIT |x|))))) + ((QUOTE T) + (SEQ + (LETT |z| |x| |ILIST;concat!;3$;25|) + (SEQ + G190 + (COND + ((NULL (COND ((NULL (QCDR |z|)) (QUOTE NIL)) ((QUOTE T) (QUOTE T)))) + (GO G191))) + (SEQ (EXIT (LETT |z| (QCDR |z|) |ILIST;concat!;3$;25|))) + NIL + (GO G190) + G191 + (EXIT NIL)) + (QRPLACD |z| |y|) + (EXIT |x|)))))))) + +(DEFUN |ILIST;removeDuplicates!;2$;26| (|l| |$|) + (PROG (|f| |p| |pr| |pp|) + (RETURN + (SEQ + (LETT |p| |l| |ILIST;removeDuplicates!;2$;26|) + (SEQ + G190 + (COND + ((NULL (COND ((NULL |p|) (QUOTE NIL)) ((QUOTE T) (QUOTE T)))) (GO G191))) + (SEQ + (LETT |pp| |p| |ILIST;removeDuplicates!;2$;26|) + (LETT |f| (QCAR |p|) |ILIST;removeDuplicates!;2$;26|) + (LETT |p| (QCDR |p|) |ILIST;removeDuplicates!;2$;26|) + (EXIT + (SEQ + G190 + (COND + ((NULL + (COND + ((NULL (LETT |pr| (QCDR |pp|) |ILIST;removeDuplicates!;2$;26|)) + (QUOTE NIL)) + ((QUOTE T) (QUOTE T)))) + (GO G191))) + (SEQ + (EXIT + (COND + ((SPADCALL (QCAR |pr|) |f| (QREFELT |$| 46)) + (QRPLACD |pp| (QCDR |pr|))) + ((QUOTE T) (LETT |pp| |pr| |ILIST;removeDuplicates!;2$;26|))))) + NIL + (GO G190) + G191 + (EXIT NIL)))) + NIL + (GO G190) + G191 + (EXIT NIL)) + (EXIT |l|))))) + +(DEFUN |ILIST;sort!;M2$;27| (|f| |l| |$|) + (|ILIST;mergeSort| |f| |l| (SPADCALL |l| (QREFELT |$| 9)) |$|)) + +(DEFUN |ILIST;merge!;M3$;28| (|f| |p| |q| |$|) + (PROG (|r| |t|) + (RETURN + (SEQ + (COND + ((NULL |p|) |q|) + ((NULL |q|) |p|) + ((EQ |p| |q|) (|error| "cannot merge a list into itself")) + ((QUOTE T) + (SEQ + (COND + ((SPADCALL (QCAR |p|) (QCAR |q|) |f|) + (SEQ + (LETT |r| (LETT |t| |p| |ILIST;merge!;M3$;28|) |ILIST;merge!;M3$;28|) + (EXIT (LETT |p| (QCDR |p|) |ILIST;merge!;M3$;28|)))) + ((QUOTE T) + (SEQ + (LETT |r| (LETT |t| |q| |ILIST;merge!;M3$;28|) |ILIST;merge!;M3$;28|) + (EXIT (LETT |q| (QCDR |q|) |ILIST;merge!;M3$;28|))))) + (SEQ + G190 + (COND + ((NULL + (COND + ((OR (NULL |p|) (NULL |q|)) (QUOTE NIL)) + ((QUOTE T) (QUOTE T)))) + (GO G191))) + (SEQ + (EXIT + (COND + ((SPADCALL (QCAR |p|) (QCAR |q|) |f|) + (SEQ + (QRPLACD |t| |p|) + (LETT |t| |p| |ILIST;merge!;M3$;28|) + (EXIT (LETT |p| (QCDR |p|) |ILIST;merge!;M3$;28|)))) + ((QUOTE T) + (SEQ + (QRPLACD |t| |q|) + (LETT |t| |q| |ILIST;merge!;M3$;28|) + (EXIT (LETT |q| (QCDR |q|) |ILIST;merge!;M3$;28|))))))) + NIL + (GO G190) + G191 + (EXIT NIL)) + (QRPLACD |t| (COND ((NULL |p|) |q|) ((QUOTE T) |p|))) + (EXIT |r|)))))))) + +(DEFUN |ILIST;split!;$I$;29| (|p| |n| |$|) + (PROG (#1=#:G102085 |q|) + (RETURN + (SEQ + (COND + ((|<| |n| 1) (|error| "index out of range")) + ((QUOTE T) + (SEQ + (LETT |p| + (SPADCALL |p| + (PROG1 + (LETT #1# (|-| |n| 1) |ILIST;split!;$I$;29|) + (|check-subtype| (|>=| #1# 0) (QUOTE (|NonNegativeInteger|)) #1#)) + (QREFELT |$| 32)) + |ILIST;split!;$I$;29|) + (LETT |q| (QCDR |p|) |ILIST;split!;$I$;29|) + (QRPLACD |p| NIL) (EXIT |q|)))))))) + +(DEFUN |ILIST;mergeSort| (|f| |p| |n| |$|) + (PROG (#1=#:G102089 |l| |q|) + (RETURN + (SEQ + (COND + ((EQL |n| 2) + (COND + ((SPADCALL + (SPADCALL (SPADCALL |p| (QREFELT |$| 18)) (QREFELT |$| 13)) + (SPADCALL |p| (QREFELT |$| 13)) |f|) + (LETT |p| (SPADCALL |p| (QREFELT |$| 28)) |ILIST;mergeSort|))))) + (EXIT + (COND + ((|<| |n| 3) |p|) + ((QUOTE T) + (SEQ + (LETT |l| + (PROG1 + (LETT #1# (QUOTIENT2 |n| 2) |ILIST;mergeSort|) + (|check-subtype| (|>=| #1# 0) (QUOTE (|NonNegativeInteger|)) #1#)) + |ILIST;mergeSort|) + (LETT |q| (SPADCALL |p| |l| (QREFELT |$| 57)) |ILIST;mergeSort|) + (LETT |p| (|ILIST;mergeSort| |f| |p| |l| |$|) |ILIST;mergeSort|) + (LETT |q| + (|ILIST;mergeSort| |f| |q| (|-| |n| |l|) |$|) + |ILIST;mergeSort|) + (EXIT (SPADCALL |f| |p| |q| (QREFELT |$| 56))))))))))) + +(DEFUN |IndexedList| (|&REST| #1=#:G102103 |&AUX| #2=#:G102101) + (DSETQ #2# #1#) + (PROG NIL + (RETURN + (PROG (#3=#:G102102) + (RETURN + (COND + ((LETT #3# + (|lassocShiftWithFunction| + (|devaluateList| #2#) + (HGET |$ConstructorCache| (QUOTE |IndexedList|)) + (QUOTE |domainEqualList|)) + |IndexedList|) + (|CDRwithIncrement| #3#)) + ((QUOTE T) + (|UNWIND-PROTECT| + (PROG1 + (APPLY (|function| |IndexedList;|) #2#) + (LETT #3# T |IndexedList|)) + (COND + ((NOT #3#) (HREM |$ConstructorCache| (QUOTE |IndexedList|)))))))))))) + +(DEFUN |IndexedList;| (|#1| |#2|) + (PROG (|DV$1| |DV$2| |dv$| |$| #1=#:G102100 |pv$|) + (RETURN + (PROGN + (LETT |DV$1| (|devaluate| |#1|) . #2=(|IndexedList|)) + (LETT |DV$2| (|devaluate| |#2|) . #2#) + (LETT |dv$| (LIST (QUOTE |IndexedList|) |DV$1| |DV$2|) . #2#) + (LETT |$| (GETREFV 71) . #2#) + (QSETREFV |$| 0 |dv$|) + (QSETREFV |$| 3 + (LETT |pv$| + (|buildPredVector| 0 0 + (LIST + (|HasCategory| |#1| (QUOTE (|SetCategory|))) + (|HasCategory| |#1| (QUOTE (|ConvertibleTo| (|InputForm|)))) + (LETT #1# (|HasCategory| |#1| (QUOTE (|OrderedSet|))) . #2#) + (OR #1# (|HasCategory| |#1| (QUOTE (|SetCategory|)))) + (|HasCategory| (|Integer|) (QUOTE (|OrderedSet|))) + (AND + (|HasCategory| |#1| (LIST (QUOTE |Evalable|) (|devaluate| |#1|))) + (|HasCategory| |#1| (QUOTE (|SetCategory|)))) + (OR + (AND + (|HasCategory| |#1| (LIST (QUOTE |Evalable|) (|devaluate| |#1|))) + #1#) + (AND + (|HasCategory| |#1| (LIST (QUOTE |Evalable|) (|devaluate| |#1|))) + (|HasCategory| |#1| (QUOTE (|SetCategory|))))))) + . #2#)) + (|haddProp| |$ConstructorCache| + (QUOTE |IndexedList|) (LIST |DV$1| |DV$2|) (CONS 1 |$|)) + (|stuffDomainSlots| |$|) + (QSETREFV |$| 6 |#1|) + (QSETREFV |$| 7 |#2|) + (COND + ((|testBitVector| |pv$| 1) + (PROGN + (QSETREFV |$| 45 (CONS (|dispatchFunction| |ILIST;coerce;$Of;21|) |$|)) + (QSETREFV |$| 47 (CONS (|dispatchFunction| |ILIST;=;2$B;22|) |$|)) + (QSETREFV |$| 50 (CONS (|dispatchFunction| |ILIST;latex;$S;23|) |$|)) + (QSETREFV |$| 51 + (CONS (|dispatchFunction| |ILIST;member?;S$B;24|) |$|))))) + (COND + ((|testBitVector| |pv$| 1) + (QSETREFV |$| 53 + (CONS (|dispatchFunction| |ILIST;removeDuplicates!;2$;26|) |$|)))) + |$|)))) + +(MAKEPROP + (QUOTE |IndexedList|) + (QUOTE |infovec|) + (LIST + (QUOTE #( + NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|) + (|NonNegativeInteger|) |ILIST;#;$Nni;1| |ILIST;concat;S2$;2| (|Boolean|) + |ILIST;eq?;2$B;3| |ILIST;first;$S;4| (QUOTE "first") |ILIST;elt;$firstS;5| + |ILIST;empty;$;6| |ILIST;empty?;$B;7| |ILIST;rest;2$;8| (QUOTE "rest") + |ILIST;elt;$rest$;9| |ILIST;setfirst!;$2S;10| |ILIST;setelt;$first2S;11| + |ILIST;setrest!;3$;12| |ILIST;setelt;$rest2$;13| (|List| 6) + |ILIST;construct;L$;14| |ILIST;parts;$L;15| |ILIST;reverse!;2$;16| + |ILIST;reverse;2$;17| (|Integer|) |ILIST;minIndex;$I;18| + |ILIST;rest;$Nni$;19| (0 . |cyclic?|) |ILIST;copy;2$;20| + (5 . |cycleEntry|) (|OutputForm|) (10 . |coerce|) (|List| |$|) + (15 . |bracket|) (|List| 36) (20 . |list|) (25 . |commaSeparate|) + (30 . |overbar|) (35 . |concat!|) (41 . |coerce|) (46 . |=|) (52 . |=|) + (|String|) (58 . |latex|) (63 . |latex|) (68 . |member?|) + |ILIST;concat!;3$;25| (74 . |removeDuplicates!|) (|Mapping| 11 6 6) + |ILIST;sort!;M2$;27| |ILIST;merge!;M3$;28| |ILIST;split!;$I$;29| + (|Mapping| 6 6 6) (|Equation| 6) (|List| 59) (|Mapping| 11 6) (|Void|) + (|UniversalSegment| 30) (QUOTE "last") (QUOTE "value") (|Mapping| 6 6) + (|InputForm|) (|SingleInteger|) (|List| 30) (|Union| 6 (QUOTE "failed")))) + (QUOTE #( + |~=| 79 |value| 85 |third| 90 |tail| 95 |swap!| 100 |split!| 107 + |sorted?| 113 |sort!| 124 |sort| 135 |size?| 146 |setvalue!| 152 + |setrest!| 158 |setlast!| 164 |setfirst!| 170 |setelt| 176 + |setchildren!| 218 |select!| 224 |select| 230 |second| 236 |sample| + 241 |reverse!| 245 |reverse| 250 |rest| 255 |removeDuplicates!| + 266 |removeDuplicates| 271 |remove!| 276 |remove| 288 |reduce| + 300 |qsetelt!| 321 |qelt| 328 |possiblyInfinite?| 334 |position| + 339 |parts| 358 |nodes| 363 |node?| 368 |new| 374 |more?| 380 + |minIndex| 386 |min| 391 |merge!| 397 |merge| 410 |members| 423 + |member?| 428 |maxIndex| 434 |max| 439 |map!| 445 |map| 451 |list| + 464 |less?| 469 |leaves| 475 |leaf?| 480 |latex| 485 |last| 490 + |insert!| 501 |insert| 515 |indices| 529 |index?| 534 |hash| 540 + |first| 545 |find| 556 |fill!| 562 |explicitlyFinite?| 568 |every?| + 573 |eval| 579 |eq?| 605 |entry?| 611 |entries| 617 |empty?| 622 + |empty| 627 |elt| 631 |distance| 674 |delete!| 680 |delete| 692 + |cyclic?| 704 |cycleTail| 709 |cycleSplit!| 714 |cycleLength| 719 + |cycleEntry| 724 |count| 729 |copyInto!| 741 |copy| 748 |convert| + 753 |construct| 758 |concat!| 763 |concat| 775 |coerce| 798 + |children| 803 |child?| 808 |any?| 814 |>=| 820 |>| 826 |=| 832 + |<=| 838 |<| 844 |#| 850)) + (QUOTE ((|shallowlyMutable| . 0) (|finiteAggregate| . 0))) + (CONS + (|makeByteWordVec2| 7 (QUOTE (0 0 0 0 0 0 0 0 0 0 3 0 0 7 4 0 0 7 1 2 4))) + (CONS + (QUOTE #(|ListAggregate&| |StreamAggregate&| |ExtensibleLinearAggregate&| + |FiniteLinearAggregate&| |UnaryRecursiveAggregate&| |LinearAggregate&| + |RecursiveAggregate&| |IndexedAggregate&| |Collection&| + |HomogeneousAggregate&| |OrderedSet&| |Aggregate&| |EltableAggregate&| + |Evalable&| |SetCategory&| NIL NIL |InnerEvalable&| NIL NIL + |BasicType&|)) + (CONS + (QUOTE #( + (|ListAggregate| 6) (|StreamAggregate| 6) + (|ExtensibleLinearAggregate| 6) (|FiniteLinearAggregate| 6) + (|UnaryRecursiveAggregate| 6) (|LinearAggregate| 6) + (|RecursiveAggregate| 6) (|IndexedAggregate| 30 6) + (|Collection| 6) (|HomogeneousAggregate| 6) (|OrderedSet|) + (|Aggregate|) (|EltableAggregate| 30 6) (|Evalable| 6) (|SetCategory|) + (|Type|) (|Eltable| 30 6) (|InnerEvalable| 6 6) (|CoercibleTo| 36) + (|ConvertibleTo| 67) (|BasicType|))) + (|makeByteWordVec2| 70 + (QUOTE (1 0 11 0 33 1 0 0 0 35 1 6 36 0 37 1 36 0 38 39 1 40 0 36 + 41 1 36 0 38 42 1 36 0 0 43 2 40 0 0 36 44 1 0 36 0 45 2 6 11 0 0 + 46 2 0 11 0 0 47 1 6 48 0 49 1 0 48 0 50 2 0 11 6 0 51 1 0 0 0 53 + 2 1 11 0 0 1 1 0 6 0 1 1 0 6 0 1 1 0 0 0 1 3 0 62 0 30 30 1 2 0 0 + 0 30 57 1 3 11 0 1 2 0 11 54 0 1 1 3 0 0 1 2 0 0 54 0 55 1 3 0 0 1 + 2 0 0 54 0 1 2 0 11 0 8 1 2 0 6 0 6 1 2 0 0 0 0 23 2 0 6 0 6 1 2 0 + 6 0 6 21 3 0 6 0 30 6 1 3 0 6 0 63 6 1 3 0 6 0 64 6 1 3 0 0 0 19 0 + 24 3 0 6 0 14 6 22 3 0 6 0 65 6 1 2 0 0 0 38 1 2 0 0 61 0 1 2 0 0 + 61 0 1 1 0 6 0 1 0 0 0 1 1 0 0 0 28 1 0 0 0 29 2 0 0 0 8 32 1 0 0 + 0 18 1 1 0 0 53 1 1 0 0 1 2 1 0 6 0 1 2 0 0 61 0 1 2 1 0 6 0 1 2 0 + 0 61 0 1 4 1 6 58 0 6 6 1 2 0 6 58 0 1 3 0 6 58 0 6 1 3 0 6 0 30 6 + 1 2 0 6 0 30 1 1 0 11 0 1 2 1 30 6 0 1 3 1 30 6 0 30 1 2 0 30 61 0 + 1 1 0 25 0 27 1 0 38 0 1 2 1 11 0 0 1 2 0 0 8 6 1 2 0 11 0 8 1 1 5 + 30 0 31 2 3 0 0 0 1 2 3 0 0 0 1 3 0 0 54 0 0 56 2 3 0 0 0 1 3 0 0 + 54 0 0 1 1 0 25 0 1 2 1 11 6 0 51 1 5 30 0 1 2 3 0 0 0 1 2 0 0 66 + 0 1 3 0 0 58 0 0 1 2 0 0 66 0 1 1 0 0 6 1 2 0 11 0 8 1 1 0 25 0 1 + 1 0 11 0 1 1 1 48 0 50 2 0 0 0 8 1 1 0 6 0 1 3 0 0 6 0 30 1 3 0 0 + 0 0 30 1 3 0 0 0 0 30 1 3 0 0 6 0 30 1 1 0 69 0 1 2 0 11 30 0 1 1 + 1 68 0 1 2 0 0 0 8 1 1 0 6 0 13 2 0 70 61 0 1 2 0 0 0 6 1 1 0 11 + 0 1 2 0 11 61 0 1 3 6 0 0 6 6 1 3 6 0 0 25 25 1 2 6 0 0 59 1 2 6 + 0 0 60 1 2 0 11 0 0 12 2 1 11 6 0 1 1 0 25 0 1 1 0 11 0 17 0 0 0 + 16 2 0 6 0 30 1 3 0 6 0 30 6 1 2 0 0 0 63 1 2 0 6 0 64 1 2 0 0 0 + 19 20 2 0 6 0 14 15 2 0 6 0 65 1 2 0 30 0 0 1 2 0 0 0 63 1 2 0 0 0 + 30 1 2 0 0 0 63 1 2 0 0 0 30 1 1 0 11 0 33 1 0 0 0 1 1 0 0 0 1 1 0 + 8 0 1 1 0 0 0 35 2 1 8 6 0 1 2 0 8 61 0 1 3 0 0 0 0 30 1 1 0 0 0 + 34 1 2 67 0 1 1 0 0 25 26 2 0 0 0 0 52 2 0 0 0 6 1 1 0 0 38 1 2 0 + 0 0 6 1 2 0 0 6 0 10 2 0 0 0 0 1 1 1 36 0 45 1 0 38 0 1 2 1 11 0 + 0 1 2 0 11 61 0 1 2 3 11 0 0 1 2 3 11 0 0 1 2 1 11 0 0 47 2 3 11 + 0 0 1 2 3 11 0 0 1 1 0 8 0 9)))))) + (QUOTE |lookupComplete|))) + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{INT.lsp BOOTSTRAP} +{\bf INT} depends on {\bf OINTDOM} which depends on {\bf ORDRING} +which depends on {\bf INT}. +We need to break this cycle to build +the algebra. So we keep a cached copy of the translated {\bf INT} +category which we can write into the {\bf MID} directory. We compile +the lisp code and copy the {\bf INT.o} file to the {\bf OUT} directory. +This is eventually forcibly replaced by a recompiled version. + +Note that this code is not included in the generated catdef.spad file. + +<>= + +(|/VERSIONCHECK| 2) + +(DEFUN |INT;writeOMInt| (|dev| |x| |$|) + (SEQ + (COND + ((|<| |x| 0) + (SEQ + (SPADCALL |dev| (QREFELT |$| 8)) + (SPADCALL |dev| "arith1" "unary_minus" (QREFELT |$| 10)) + (SPADCALL |dev| (|-| |x|) (QREFELT |$| 12)) + (EXIT (SPADCALL |dev| (QREFELT |$| 13))))) + ((QUOTE T) (SPADCALL |dev| |x| (QREFELT |$| 12)))))) + +(DEFUN |INT;OMwrite;$S;2| (|x| |$|) + (PROG (|sp| |dev| |s|) + (RETURN + (SEQ + (LETT |s| "" |INT;OMwrite;$S;2|) + (LETT |sp| (|OM-STRINGTOSTRINGPTR| |s|) |INT;OMwrite;$S;2|) + (LETT |dev| + (SPADCALL |sp| (SPADCALL (QREFELT |$| 15)) (QREFELT |$| 16)) + |INT;OMwrite;$S;2|) + (SPADCALL |dev| (QREFELT |$| 17)) + (|INT;writeOMInt| |dev| |x| |$|) + (SPADCALL |dev| (QREFELT |$| 18)) + (SPADCALL |dev| (QREFELT |$| 19)) + (LETT |s| (|OM-STRINGPTRTOSTRING| |sp|) |INT;OMwrite;$S;2|) + (EXIT |s|))))) + +(DEFUN |INT;OMwrite;$BS;3| (|x| |wholeObj| |$|) + (PROG (|sp| |dev| |s|) + (RETURN + (SEQ + (LETT |s| "" |INT;OMwrite;$BS;3|) + (LETT |sp| (|OM-STRINGTOSTRINGPTR| |s|) |INT;OMwrite;$BS;3|) + (LETT |dev| + (SPADCALL |sp| (SPADCALL (QREFELT |$| 15)) (QREFELT |$| 16)) + |INT;OMwrite;$BS;3|) + (COND (|wholeObj| (SPADCALL |dev| (QREFELT |$| 17)))) + (|INT;writeOMInt| |dev| |x| |$|) + (COND (|wholeObj| (SPADCALL |dev| (QREFELT |$| 18)))) + (SPADCALL |dev| (QREFELT |$| 19)) + (LETT |s| (|OM-STRINGPTRTOSTRING| |sp|) |INT;OMwrite;$BS;3|) + (EXIT |s|))))) + +(DEFUN |INT;OMwrite;Omd$V;4| (|dev| |x| |$|) + (SEQ + (SPADCALL |dev| (QREFELT |$| 17)) + (|INT;writeOMInt| |dev| |x| |$|) + (EXIT (SPADCALL |dev| (QREFELT |$| 18))))) + +(DEFUN |INT;OMwrite;Omd$BV;5| (|dev| |x| |wholeObj| |$|) + (SEQ + (COND (|wholeObj| (SPADCALL |dev| (QREFELT |$| 17)))) + (|INT;writeOMInt| |dev| |x| |$|) + (EXIT (COND (|wholeObj| (SPADCALL |dev| (QREFELT |$| 18))))))) + +(PUT (QUOTE |INT;zero?;$B;6|) (QUOTE |SPADreplace|) (QUOTE ZEROP)) + +(DEFUN |INT;zero?;$B;6| (|x| |$|) (ZEROP |x|)) + +(PUT (QUOTE |INT;Zero;$;7|) (QUOTE |SPADreplace|) (QUOTE (XLAM NIL 0))) + +(DEFUN |INT;Zero;$;7| (|$|) 0) + +(PUT (QUOTE |INT;One;$;8|) (QUOTE |SPADreplace|) (QUOTE (XLAM NIL 1))) + +(DEFUN |INT;One;$;8| (|$|) 1) + +(PUT (QUOTE |INT;base;$;9|) (QUOTE |SPADreplace|) (QUOTE (XLAM NIL 2))) + +(DEFUN |INT;base;$;9| (|$|) 2) + +(PUT (QUOTE |INT;copy;2$;10|) (QUOTE |SPADreplace|) (QUOTE (XLAM (|x|) |x|))) + +(DEFUN |INT;copy;2$;10| (|x| |$|) |x|) + +(PUT + (QUOTE |INT;inc;2$;11|) + (QUOTE |SPADreplace|) + (QUOTE (XLAM (|x|) (|+| |x| 1)))) + +(DEFUN |INT;inc;2$;11| (|x| |$|) (|+| |x| 1)) + +(PUT + (QUOTE |INT;dec;2$;12|) + (QUOTE |SPADreplace|) + (QUOTE (XLAM (|x|) (|-| |x| 1)))) + +(DEFUN |INT;dec;2$;12| (|x| |$|) (|-| |x| 1)) + +(PUT (QUOTE |INT;hash;2$;13|) (QUOTE |SPADreplace|) (QUOTE SXHASH)) + +(DEFUN |INT;hash;2$;13| (|x| |$|) (SXHASH |x|)) + +(PUT (QUOTE |INT;negative?;$B;14|) (QUOTE |SPADreplace|) (QUOTE MINUSP)) + +(DEFUN |INT;negative?;$B;14| (|x| |$|) (MINUSP |x|)) + +(DEFUN |INT;coerce;$Of;15| (|x| |$|) (SPADCALL |x| (QREFELT |$| 35))) + +(PUT + (QUOTE |INT;coerce;2$;16|) + (QUOTE |SPADreplace|) + (QUOTE (XLAM (|m|) |m|))) + +(DEFUN |INT;coerce;2$;16| (|m| |$|) |m|) + +(PUT + (QUOTE |INT;convert;2$;17|) + (QUOTE |SPADreplace|) + (QUOTE (XLAM (|x|) |x|))) + +(DEFUN |INT;convert;2$;17| (|x| |$|) |x|) + +(PUT + (QUOTE |INT;length;2$;18|) + (QUOTE |SPADreplace|) + (QUOTE |INTEGER-LENGTH|)) + +(DEFUN |INT;length;2$;18| (|a| |$|) (|INTEGER-LENGTH| |a|)) + +(DEFUN |INT;addmod;4$;19| (|a| |b| |p| |$|) + (PROG (|c| #1=#:G86338) + (RETURN + (SEQ + (EXIT + (SEQ + (SEQ + (LETT |c| (|+| |a| |b|) |INT;addmod;4$;19|) + (EXIT + (COND + ((NULL (|<| |c| |p|)) + (PROGN (LETT #1# (|-| |c| |p|) |INT;addmod;4$;19|) (GO #1#)))))) + (EXIT |c|))) + #1# + (EXIT #1#))))) + +(DEFUN |INT;submod;4$;20| (|a| |b| |p| |$|) + (PROG (|c|) + (RETURN + (SEQ + (LETT |c| (|-| |a| |b|) |INT;submod;4$;20|) + (EXIT (COND ((|<| |c| 0) (|+| |c| |p|)) ((QUOTE T) |c|))))))) + +(DEFUN |INT;mulmod;4$;21| (|a| |b| |p| |$|) (REMAINDER2 (|*| |a| |b|) |p|)) + +(DEFUN |INT;convert;$F;22| (|x| |$|) (SPADCALL |x| (QREFELT |$| 44))) + +(PUT + (QUOTE |INT;convert;$Df;23|) + (QUOTE |SPADreplace|) + (QUOTE (XLAM (|x|) (FLOAT |x| |MOST-POSITIVE-LONG-FLOAT|)))) + +(DEFUN |INT;convert;$Df;23| (|x| |$|) (FLOAT |x| |MOST-POSITIVE-LONG-FLOAT|)) + +(DEFUN |INT;convert;$If;24| (|x| |$|) (SPADCALL |x| (QREFELT |$| 49))) + +(PUT (QUOTE |INT;convert;$S;25|) (QUOTE |SPADreplace|) (QUOTE STRINGIMAGE)) + +(DEFUN |INT;convert;$S;25| (|x| |$|) (STRINGIMAGE |x|)) + +(DEFUN |INT;latex;$S;26| (|x| |$|) + (PROG (|s|) + (RETURN + (SEQ + (LETT |s| (STRINGIMAGE |x|) |INT;latex;$S;26|) + (COND ((|<| -1 |x|) (COND ((|<| |x| 10) (EXIT |s|))))) + (EXIT (STRCONC "{" (STRCONC |s| "}"))))))) + +(DEFUN |INT;positiveRemainder;3$;27| (|a| |b| |$|) + (PROG (|r|) + (RETURN + (COND + ((MINUSP (LETT |r| (REMAINDER2 |a| |b|) |INT;positiveRemainder;3$;27|)) + (COND + ((MINUSP |b|) (|-| |r| |b|)) + ((QUOTE T) (|+| |r| |b|)))) + ((QUOTE T) |r|))))) + +(PUT + (QUOTE |INT;reducedSystem;2M;28|) + (QUOTE |SPADreplace|) + (QUOTE (XLAM (|m|) |m|))) + +(DEFUN |INT;reducedSystem;2M;28| (|m| |$|) |m|) + +(DEFUN |INT;reducedSystem;MVR;29| (|m| |v| |$|) (CONS |m| (QUOTE |vec|))) + +(PUT (QUOTE |INT;abs;2$;30|) (QUOTE |SPADreplace|) (QUOTE ABS)) + +(DEFUN |INT;abs;2$;30| (|x| |$|) (ABS |x|)) + +(PUT (QUOTE |INT;random;$;31|) (QUOTE |SPADreplace|) (QUOTE |random|)) + +(DEFUN |INT;random;$;31| (|$|) (|random|)) + +(PUT (QUOTE |INT;random;2$;32|) (QUOTE |SPADreplace|) (QUOTE RANDOM)) + +(DEFUN |INT;random;2$;32| (|x| |$|) (RANDOM |x|)) + +(PUT (QUOTE |INT;=;2$B;33|) (QUOTE |SPADreplace|) (QUOTE EQL)) + +(DEFUN |INT;=;2$B;33| (|x| |y| |$|) (EQL |x| |y|)) + +(PUT (QUOTE |INT;<;2$B;34|) (QUOTE |SPADreplace|) (QUOTE |<|)) + +(DEFUN |INT;<;2$B;34| (|x| |y| |$|) (|<| |x| |y|)) + +(PUT (QUOTE |INT;-;2$;35|) (QUOTE |SPADreplace|) (QUOTE |-|)) + +(DEFUN |INT;-;2$;35| (|x| |$|) (|-| |x|)) + +(PUT (QUOTE |INT;+;3$;36|) (QUOTE |SPADreplace|) (QUOTE |+|)) + +(DEFUN |INT;+;3$;36| (|x| |y| |$|) (|+| |x| |y|)) + +(PUT (QUOTE |INT;-;3$;37|) (QUOTE |SPADreplace|) (QUOTE |-|)) + +(DEFUN |INT;-;3$;37| (|x| |y| |$|) (|-| |x| |y|)) + +(PUT (QUOTE |INT;*;3$;38|) (QUOTE |SPADreplace|) (QUOTE |*|)) + +(DEFUN |INT;*;3$;38| (|x| |y| |$|) (|*| |x| |y|)) + +(PUT (QUOTE |INT;*;3$;39|) (QUOTE |SPADreplace|) (QUOTE |*|)) + +(DEFUN |INT;*;3$;39| (|m| |y| |$|) (|*| |m| |y|)) + +(PUT (QUOTE |INT;**;$Nni$;40|) (QUOTE |SPADreplace|) (QUOTE EXPT)) + +(DEFUN |INT;**;$Nni$;40| (|x| |n| |$|) (EXPT |x| |n|)) + +(PUT (QUOTE |INT;odd?;$B;41|) (QUOTE |SPADreplace|) (QUOTE ODDP)) + +(DEFUN |INT;odd?;$B;41| (|x| |$|) (ODDP |x|)) + +(PUT (QUOTE |INT;max;3$;42|) (QUOTE |SPADreplace|) (QUOTE MAX)) + +(DEFUN |INT;max;3$;42| (|x| |y| |$|) (MAX |x| |y|)) + +(PUT (QUOTE |INT;min;3$;43|) (QUOTE |SPADreplace|) (QUOTE MIN)) + +(DEFUN |INT;min;3$;43| (|x| |y| |$|) (MIN |x| |y|)) + +(PUT (QUOTE |INT;divide;2$R;44|) (QUOTE |SPADreplace|) (QUOTE DIVIDE2)) + +(DEFUN |INT;divide;2$R;44| (|x| |y| |$|) (DIVIDE2 |x| |y|)) + +(PUT (QUOTE |INT;quo;3$;45|) (QUOTE |SPADreplace|) (QUOTE QUOTIENT2)) + +(DEFUN |INT;quo;3$;45| (|x| |y| |$|) (QUOTIENT2 |x| |y|)) + +(PUT (QUOTE |INT;rem;3$;46|) (QUOTE |SPADreplace|) (QUOTE REMAINDER2)) + +(DEFUN |INT;rem;3$;46| (|x| |y| |$|) (REMAINDER2 |x| |y|)) + +(PUT (QUOTE |INT;shift;3$;47|) (QUOTE |SPADreplace|) (QUOTE ASH)) + +(DEFUN |INT;shift;3$;47| (|x| |y| |$|) (ASH |x| |y|)) + +(DEFUN |INT;exquo;2$U;48| (|x| |y| |$|) + (COND + ((OR (ZEROP |y|) (NULL (ZEROP (REMAINDER2 |x| |y|)))) (CONS 1 "failed")) + ((QUOTE T) (CONS 0 (QUOTIENT2 |x| |y|))))) + +(DEFUN |INT;recip;$U;49| (|x| |$|) + (COND + ((OR (EQL |x| 1) (EQL |x| -1)) (CONS 0 |x|)) + ((QUOTE T) (CONS 1 "failed")))) + +(PUT (QUOTE |INT;gcd;3$;50|) (QUOTE |SPADreplace|) (QUOTE GCD)) + +(DEFUN |INT;gcd;3$;50| (|x| |y| |$|) (GCD |x| |y|)) + +(DEFUN |INT;unitNormal;$R;51| (|x| |$|) + (COND + ((|<| |x| 0) (VECTOR -1 (|-| |x|) -1)) + ((QUOTE T) (VECTOR 1 |x| 1)))) + +(PUT (QUOTE |INT;unitCanonical;2$;52|) (QUOTE |SPADreplace|) (QUOTE ABS)) + +(DEFUN |INT;unitCanonical;2$;52| (|x| |$|) (ABS |x|)) + +(DEFUN |INT;solveLinearPolynomialEquation| (|lp| |p| |$|) + (SPADCALL |lp| |p| (QREFELT |$| 91))) + +(DEFUN |INT;squareFreePolynomial| (|p| |$|) (SPADCALL |p| (QREFELT |$| 95))) + +(DEFUN |INT;factorPolynomial| (|p| |$|) + (PROG (|pp| #1=#:G86409) + (RETURN + (SEQ + (LETT |pp| (SPADCALL |p| (QREFELT |$| 96)) |INT;factorPolynomial|) + (EXIT + (COND + ((EQL (SPADCALL |pp| (QREFELT |$| 97)) (SPADCALL |p| (QREFELT |$| 97))) + (SPADCALL |p| (QREFELT |$| 99))) + ((QUOTE T) + (SPADCALL + (SPADCALL |pp| (QREFELT |$| 99)) + (SPADCALL + (CONS (FUNCTION |INT;factorPolynomial!0|) |$|) + (SPADCALL + (PROG2 + (LETT #1# + (SPADCALL + (SPADCALL |p| (QREFELT |$| 97)) + (SPADCALL |pp| (QREFELT |$| 97)) + (QREFELT |$| 81)) + |INT;factorPolynomial|) + (QCDR #1#) + (|check-union| (QEQCAR #1# 0) |$| #1#)) + (QREFELT |$| 102)) + (QREFELT |$| 106)) + (QREFELT |$| 108))))))))) + +(DEFUN |INT;factorPolynomial!0| (|#1| |$|) (SPADCALL |#1| (QREFELT |$| 100))) + +(DEFUN |INT;factorSquareFreePolynomial| (|p| |$|) + (SPADCALL |p| (QREFELT |$| 109))) + +(DEFUN |INT;gcdPolynomial;3Sup;57| (|p| |q| |$|) + (COND + ((SPADCALL |p| (QREFELT |$| 110)) (SPADCALL |q| (QREFELT |$| 111))) + ((SPADCALL |q| (QREFELT |$| 110)) (SPADCALL |p| (QREFELT |$| 111))) + ((QUOTE T) (SPADCALL (LIST |p| |q|) (QREFELT |$| 114))))) + +(DEFUN |Integer| NIL + (PROG NIL + (RETURN + (PROG (#1=#:G86434) + (RETURN + (COND + ((LETT #1# (HGET |$ConstructorCache| (QUOTE |Integer|)) |Integer|) + (|CDRwithIncrement| (CDAR #1#))) + ((QUOTE T) + (|UNWIND-PROTECT| + (PROG1 + (CDDAR + (HPUT |$ConstructorCache| (QUOTE |Integer|) + (LIST (CONS NIL (CONS 1 (|Integer;|)))))) + (LETT #1# T |Integer|)) + (COND + ((NOT #1#) (HREM |$ConstructorCache| (QUOTE |Integer|)))))))))))) + +(DEFUN |Integer;| NIL + (PROG (|dv$| |$| |pv$|) + (RETURN + (PROGN + (LETT |dv$| (QUOTE (|Integer|)) . #1=(|Integer|)) + (LETT |$| (GETREFV 130) . #1#) + (QSETREFV |$| 0 |dv$|) + (QSETREFV |$| 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#)) + (|haddProp| |$ConstructorCache| (QUOTE |Integer|) NIL (CONS 1 |$|)) + (|stuffDomainSlots| |$|) + (QSETREFV |$| 69 + (QSETREFV |$| 68 (CONS (|dispatchFunction| |INT;*;3$;39|) |$|))) + |$|)))) + +(MAKEPROP + (QUOTE |Integer|) + (QUOTE |infovec|) + (LIST + (QUOTE + #(NIL NIL NIL NIL NIL NIL (|Void|) (|OpenMathDevice|) (0 . |OMputApp|) + (|String|) (5 . |OMputSymbol|) (|Integer|) (12 . |OMputInteger|) + (18 . |OMputEndApp|) (|OpenMathEncoding|) (23 . |OMencodingXML|) + (27 . |OMopenString|) (33 . |OMputObject|) (38 . |OMputEndObject|) + (43 . |OMclose|) |INT;OMwrite;$S;2| (|Boolean|) |INT;OMwrite;$BS;3| + |INT;OMwrite;Omd$V;4| |INT;OMwrite;Omd$BV;5| |INT;zero?;$B;6| + (CONS IDENTITY (FUNCALL (|dispatchFunction| |INT;Zero;$;7|) |$|)) + (CONS IDENTITY (FUNCALL (|dispatchFunction| |INT;One;$;8|) |$|)) + |INT;base;$;9| |INT;copy;2$;10| |INT;inc;2$;11| |INT;dec;2$;12| + |INT;hash;2$;13| |INT;negative?;$B;14| (|OutputForm|) + (48 . |outputForm|) |INT;coerce;$Of;15| |INT;coerce;2$;16| + |INT;convert;2$;17| |INT;length;2$;18| |INT;addmod;4$;19| + |INT;submod;4$;20| |INT;mulmod;4$;21| (|Float|) (53 . |coerce|) + |INT;convert;$F;22| (|DoubleFloat|) |INT;convert;$Df;23| (|InputForm|) + (58 . |convert|) |INT;convert;$If;24| |INT;convert;$S;25| + |INT;latex;$S;26| |INT;positiveRemainder;3$;27| (|Matrix| 11) + (|Matrix| |$|) |INT;reducedSystem;2M;28| + (|Record| (|:| |mat| 54) (|:| |vec| (|Vector| 11))) + (|Vector| |$|) |INT;reducedSystem;MVR;29| |INT;abs;2$;30| + |INT;random;$;31| |INT;random;2$;32| |INT;=;2$B;33| + |INT;<;2$B;34| |INT;-;2$;35| |INT;+;3$;36| |INT;-;3$;37| NIL NIL + (|NonNegativeInteger|) |INT;**;$Nni$;40| |INT;odd?;$B;41| + |INT;max;3$;42| |INT;min;3$;43| + (|Record| (|:| |quotient| |$|) (|:| |remainder| |$|)) + |INT;divide;2$R;44| |INT;quo;3$;45| |INT;rem;3$;46| |INT;shift;3$;47| + (|Union| |$| (QUOTE "failed")) |INT;exquo;2$U;48| |INT;recip;$U;49| + |INT;gcd;3$;50| + (|Record| (|:| |unit| |$|) (|:| |canonical| |$|) (|:| |associate| |$|)) + |INT;unitNormal;$R;51| |INT;unitCanonical;2$;52| + (|Union| 88 (QUOTE "failed")) (|List| 89) + (|SparseUnivariatePolynomial| 11) + (|IntegerSolveLinearPolynomialEquation|) + (63 . |solveLinearPolynomialEquation|) (|Factored| 93) + (|SparseUnivariatePolynomial| |$$|) + (|UnivariatePolynomialSquareFree| |$$| 93) (69 . |squareFree|) + (74 . |primitivePart|) (79 . |leadingCoefficient|) + (|GaloisGroupFactorizer| 93) (84 . |factor|) (89 . |coerce|) + (|Factored| |$|) (94 . |factor|) (|Mapping| 93 |$$|) + (|Factored| |$$|) (|FactoredFunctions2| |$$| 93) (99 . |map|) + (|FactoredFunctionUtilities| 93) (105 . |mergeFactors|) + (111 . |factorSquareFree|) (116 . |zero?|) (121 . |unitCanonical|) + (|List| 93) (|HeuGcd| 93) (126 . |gcd|) + (|SparseUnivariatePolynomial| |$|) |INT;gcdPolynomial;3Sup;57| + (|Union| 118 (QUOTE "failed")) (|Fraction| 11) + (|PatternMatchResult| 11 |$|) (|Pattern| 11) + (|Union| 11 (QUOTE "failed")) (|Union| 123 (QUOTE "failed")) + (|List| |$|) + (|Record| (|:| |coef| 123) (|:| |generator| |$|)) + (|Record| (|:| |coef1| |$|) (|:| |coef2| |$|)) + (|Union| 125 (QUOTE "failed")) + (|Record| (|:| |coef1| |$|) (|:| |coef2| |$|) (|:| |generator| |$|)) + (|PositiveInteger|) (|SingleInteger|))) + (QUOTE #(|~=| 131 |zero?| 137 |unitNormal| 142 |unitCanonical| 147 + |unit?| 152 |symmetricRemainder| 157 |subtractIfCan| 163 |submod| 169 + |squareFreePart| 176 |squareFree| 181 |sizeLess?| 186 |sign| 192 + |shift| 197 |sample| 203 |retractIfCan| 207 |retract| 212 |rem| 217 + |reducedSystem| 223 |recip| 234 |rationalIfCan| 239 |rational?| 244 + |rational| 249 |random| 254 |quo| 263 |principalIdeal| 269 + |prime?| 274 |powmod| 279 |positiveRemainder| 286 |positive?| 292 + |permutation| 297 |patternMatch| 303 |one?| 310 |odd?| 315 + |nextItem| 320 |negative?| 325 |multiEuclidean| 330 |mulmod| 336 + |min| 343 |max| 349 |mask| 355 |length| 360 |lcm| 365 |latex| 376 + |invmod| 381 |init| 387 |inc| 391 |hash| 396 |gcdPolynomial| 406 + |gcd| 412 |factorial| 423 |factor| 428 |extendedEuclidean| 433 + |exquo| 446 |expressIdealMember| 452 |even?| 458 + |euclideanSize| 463 |divide| 468 |differentiate| 474 |dec| 485 + |copy| 490 |convert| 495 |coerce| 525 |characteristic| 545 + |bit?| 549 |binomial| 555 |base| 561 |associates?| 565 + |addmod| 571 |abs| 578 |^| 583 |Zero| 595 |One| 599 + |OMwrite| 603 D 627 |>=| 638 |>| 644 |=| 650 |<=| 656 |<| 662 + |-| 668 |+| 679 |**| 685 |*| 697)) + (QUOTE ( + (|infinite| . 0) (|noetherian| . 0) (|canonicalsClosed| . 0) + (|canonical| . 0) (|canonicalUnitNormal| . 0) + (|multiplicativeValuation| . 0) (|noZeroDivisors| . 0) + ((|commutative| "*") . 0) (|rightUnitary| . 0) (|leftUnitary| . 0) + (|unitsKnown| . 0))) + (CONS + (|makeByteWordVec2| 1 + (QUOTE (0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0))) + (CONS + (QUOTE #( + |IntegerNumberSystem&| |EuclideanDomain&| |UniqueFactorizationDomain&| + NIL NIL |GcdDomain&| |IntegralDomain&| |Algebra&| NIL NIL + |DifferentialRing&| |OrderedRing&| NIL NIL |Module&| NIL NIL + |Ring&| NIL NIL NIL NIL NIL |AbelianGroup&| NIL NIL + |AbelianMonoid&| |Monoid&| NIL NIL |OrderedSet&| + |AbelianSemiGroup&| |SemiGroup&| NIL |SetCategory&| + NIL NIL NIL NIL NIL NIL NIL |RetractableTo&| NIL |BasicType&| NIL)) + (CONS + (QUOTE #( + (|IntegerNumberSystem|) (|EuclideanDomain|) + (|UniqueFactorizationDomain|) (|PrincipalIdealDomain|) + (|OrderedIntegralDomain|) (|GcdDomain|) (|IntegralDomain|) + (|Algebra| |$$|) (|CharacteristicZero|) (|LinearlyExplicitRingOver| 11) + (|DifferentialRing|) (|OrderedRing|) (|CommutativeRing|) (|EntireRing|) + (|Module| |$$|) (|OrderedAbelianGroup|) (|BiModule| |$$| |$$|) + (|Ring|) (|OrderedCancellationAbelianMonoid|) (|LeftModule| |$$|) + (|Rng|) (|RightModule| |$$|) (|OrderedAbelianMonoid|) (|AbelianGroup|) + (|OrderedAbelianSemiGroup|) (|CancellationAbelianMonoid|) + (|AbelianMonoid|) (|Monoid|) (|StepThrough|) (|PatternMatchable| 11) + (|OrderedSet|) (|AbelianSemiGroup|) (|SemiGroup|) (|RealConstant|) + (|SetCategory|) (|OpenMath|) (|ConvertibleTo| 9) + (|ConvertibleTo| 43) (|ConvertibleTo| 46) + (|CombinatorialFunctionCategory|) (|ConvertibleTo| 120) + (|ConvertibleTo| 48) (|RetractableTo| 11) (|ConvertibleTo| 11) + (|BasicType|) (|CoercibleTo| 34))) + (|makeByteWordVec2| 129 (QUOTE (1 7 6 0 8 3 7 6 0 9 9 10 2 7 6 0 11 + 12 1 7 6 0 13 0 14 0 15 2 7 0 9 14 16 1 7 6 0 17 1 7 6 0 18 1 7 6 0 + 19 1 34 0 11 35 1 43 0 11 44 1 48 0 11 49 2 90 87 88 89 91 1 94 92 + 93 95 1 93 0 0 96 1 93 2 0 97 1 98 92 93 99 1 93 0 2 100 1 0 101 0 + 102 2 105 92 103 104 106 2 107 92 92 92 108 1 98 92 93 109 1 93 21 + 0 110 1 93 0 0 111 1 113 93 112 114 2 0 21 0 0 1 1 0 21 0 25 1 0 84 + 0 85 1 0 0 0 86 1 0 21 0 1 2 0 0 0 0 1 2 0 80 0 0 1 3 0 0 0 0 0 41 + 1 0 0 0 1 1 0 101 0 1 2 0 21 0 0 1 1 0 11 0 1 2 0 0 0 0 79 0 0 0 1 + 1 0 121 0 1 1 0 11 0 1 2 0 0 0 0 78 2 0 57 55 58 59 1 0 54 55 56 1 + 0 80 0 82 1 0 117 0 1 1 0 21 0 1 1 0 118 0 1 1 0 0 0 62 0 0 0 61 2 + 0 0 0 0 77 1 0 124 123 1 1 0 21 0 1 3 0 0 0 0 0 1 2 0 0 0 0 53 1 0 + 21 0 1 2 0 0 0 0 1 3 0 119 0 120 119 1 1 0 21 0 1 1 0 21 0 72 1 0 + 80 0 1 1 0 21 0 33 2 0 122 123 0 1 3 0 0 0 0 0 42 2 0 0 0 0 74 2 0 + 0 0 0 73 1 0 0 0 1 1 0 0 0 39 1 0 0 123 1 2 0 0 0 0 1 1 0 9 0 52 2 + 0 0 0 0 1 0 0 0 1 1 0 0 0 30 1 0 0 0 32 1 0 129 0 1 2 0 115 115 115 + 116 2 0 0 0 0 83 1 0 0 123 1 1 0 0 0 1 1 0 101 0 102 3 0 126 0 0 0 + 1 2 0 127 0 0 1 2 0 80 0 0 81 2 0 122 123 0 1 1 0 21 0 1 1 0 70 0 + 1 2 0 75 0 0 76 1 0 0 0 1 2 0 0 0 70 1 1 0 0 0 31 1 0 0 0 29 1 0 9 + 0 51 1 0 46 0 47 1 0 43 0 45 1 0 48 0 50 1 0 120 0 1 1 0 11 0 38 1 + 0 0 11 37 1 0 0 11 37 1 0 0 0 1 1 0 34 0 36 0 0 70 1 2 0 21 0 0 1 + 2 0 0 0 0 1 0 0 0 28 2 0 21 0 0 1 3 0 0 0 0 0 40 1 0 0 0 60 2 0 0 + 0 70 1 2 0 0 0 128 1 0 0 0 26 0 0 0 27 3 0 6 7 0 21 24 2 0 9 0 21 + 22 2 0 6 7 0 23 1 0 9 0 20 1 0 0 0 1 2 0 0 0 70 1 2 0 21 0 0 1 2 + 0 21 0 0 1 2 0 21 0 0 63 2 0 21 0 0 1 2 0 21 0 0 64 2 0 0 0 0 67 + 1 0 0 0 65 2 0 0 0 0 66 2 0 0 0 70 71 2 0 0 0 128 1 2 0 0 0 0 68 + 2 0 0 11 0 69 2 0 0 70 0 1 2 0 0 128 0 1)))))) + (QUOTE |lookupComplete|))) + +(MAKEPROP (QUOTE |Integer|) (QUOTE NILADIC) T) +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{LIST.lsp BOOTSTRAP} +{\bf LIST} depends on a chain of +files. We need to break this cycle to build the algebra. So we keep a +cached copy of the translated {\bf LIST} category which we can write +into the {\bf MID} directory. We compile the lisp code and copy the +{\bf LIST.o} file to the {\bf OUT} directory. This is eventually +forcibly replaced by a recompiled version. + +Note that this code is not included in the generated catdef.spad file. + +<>= + +(|/VERSIONCHECK| 2) + +(PUT (QUOTE |LIST;nil;$;1|) (QUOTE |SPADreplace|) (QUOTE (XLAM NIL NIL))) + +(DEFUN |LIST;nil;$;1| (|$|) NIL) + +(PUT (QUOTE |LIST;null;$B;2|) (QUOTE |SPADreplace|) (QUOTE NULL)) + +(DEFUN |LIST;null;$B;2| (|l| |$|) (NULL |l|)) + +(PUT (QUOTE |LIST;cons;S2$;3|) (QUOTE |SPADreplace|) (QUOTE CONS)) + +(DEFUN |LIST;cons;S2$;3| (|s| |l| |$|) (CONS |s| |l|)) + +(PUT (QUOTE |LIST;append;3$;4|) (QUOTE |SPADreplace|) (QUOTE APPEND)) + +(DEFUN |LIST;append;3$;4| (|l| |t| |$|) (APPEND |l| |t|)) + +(DEFUN |LIST;writeOMList| (|dev| |x| |$|) + (SEQ + (SPADCALL |dev| (QREFELT |$| 14)) + (SPADCALL |dev| "list1" "list" (QREFELT |$| 16)) + (SEQ + G190 + (COND + ((NULL (COND ((NULL |x|) (QUOTE NIL)) ((QUOTE T) (QUOTE T)))) (GO G191))) + (SEQ + (SPADCALL |dev| (|SPADfirst| |x|) (QUOTE NIL) (QREFELT |$| 17)) + (EXIT (LETT |x| (CDR |x|) |LIST;writeOMList|))) + NIL + (GO G190) + G191 + (EXIT NIL)) + (EXIT (SPADCALL |dev| (QREFELT |$| 18))))) + +(DEFUN |LIST;OMwrite;$S;6| (|x| |$|) + (PROG (|sp| |dev| |s|) + (RETURN + (SEQ + (LETT |s| "" |LIST;OMwrite;$S;6|) + (LETT |sp| (|OM-STRINGTOSTRINGPTR| |s|) |LIST;OMwrite;$S;6|) + (LETT |dev| + (SPADCALL |sp| (SPADCALL (QREFELT |$| 20)) (QREFELT |$| 21)) + |LIST;OMwrite;$S;6|) + (SPADCALL |dev| (QREFELT |$| 22)) + (|LIST;writeOMList| |dev| |x| |$|) + (SPADCALL |dev| (QREFELT |$| 23)) + (SPADCALL |dev| (QREFELT |$| 24)) + (LETT |s| (|OM-STRINGPTRTOSTRING| |sp|) |LIST;OMwrite;$S;6|) + (EXIT |s|))))) + +(DEFUN |LIST;OMwrite;$BS;7| (|x| |wholeObj| |$|) + (PROG (|sp| |dev| |s|) + (RETURN + (SEQ + (LETT |s| "" |LIST;OMwrite;$BS;7|) + (LETT |sp| (|OM-STRINGTOSTRINGPTR| |s|) |LIST;OMwrite;$BS;7|) + (LETT |dev| + (SPADCALL |sp| (SPADCALL (QREFELT |$| 20)) (QREFELT |$| 21)) + |LIST;OMwrite;$BS;7|) + (COND (|wholeObj| (SPADCALL |dev| (QREFELT |$| 22)))) + (|LIST;writeOMList| |dev| |x| |$|) + (COND (|wholeObj| (SPADCALL |dev| (QREFELT |$| 23)))) + (SPADCALL |dev| (QREFELT |$| 24)) + (LETT |s| (|OM-STRINGPTRTOSTRING| |sp|) |LIST;OMwrite;$BS;7|) + (EXIT |s|))))) + +(DEFUN |LIST;OMwrite;Omd$V;8| (|dev| |x| |$|) + (SEQ + (SPADCALL |dev| (QREFELT |$| 22)) + (|LIST;writeOMList| |dev| |x| |$|) + (EXIT (SPADCALL |dev| (QREFELT |$| 23))))) + +(DEFUN |LIST;OMwrite;Omd$BV;9| (|dev| |x| |wholeObj| |$|) + (SEQ + (COND (|wholeObj| (SPADCALL |dev| (QREFELT |$| 22)))) + (|LIST;writeOMList| |dev| |x| |$|) + (EXIT (COND (|wholeObj| (SPADCALL |dev| (QREFELT |$| 23))))))) + +(DEFUN |LIST;setUnion;3$;10| (|l1| |l2| |$|) + (SPADCALL (SPADCALL |l1| |l2| (QREFELT |$| 29)) (QREFELT |$| 30))) + +(DEFUN |LIST;setIntersection;3$;11| (|l1| |l2| |$|) + (PROG (|u|) + (RETURN + (SEQ + (LETT |u| NIL |LIST;setIntersection;3$;11|) + (LETT |l1| (SPADCALL |l1| (QREFELT |$| 30)) |LIST;setIntersection;3$;11|) + (SEQ + G190 + (COND + ((NULL (COND ((NULL |l1|) (QUOTE NIL)) ((QUOTE T) (QUOTE T)))) + (GO G191))) + (SEQ + (COND + ((SPADCALL (|SPADfirst| |l1|) |l2| (QREFELT |$| 32)) + (LETT |u| (CONS (|SPADfirst| |l1|) |u|) |LIST;setIntersection;3$;11|))) + (EXIT (LETT |l1| (CDR |l1|) |LIST;setIntersection;3$;11|))) + NIL + (GO G190) + G191 + (EXIT NIL)) + (EXIT |u|))))) + +(DEFUN |LIST;setDifference;3$;12| (|l1| |l2| |$|) + (PROG (|l11| |lu|) + (RETURN + (SEQ + (LETT |l1| (SPADCALL |l1| (QREFELT |$| 30)) |LIST;setDifference;3$;12|) + (LETT |lu| NIL |LIST;setDifference;3$;12|) + (SEQ + G190 + (COND + ((NULL (COND ((NULL |l1|) (QUOTE NIL)) ((QUOTE T) (QUOTE T)))) + (GO G191))) + (SEQ + (LETT |l11| + (SPADCALL |l1| 1 (QREFELT |$| 35)) + |LIST;setDifference;3$;12|) + (COND + ((NULL (SPADCALL |l11| |l2| (QREFELT |$| 32))) + (LETT |lu| (CONS |l11| |lu|) |LIST;setDifference;3$;12|))) + (EXIT (LETT |l1| (CDR |l1|) |LIST;setDifference;3$;12|))) + NIL + (GO G190) + G191 + (EXIT NIL)) + (EXIT |lu|))))) + +(DEFUN |LIST;convert;$If;13| (|x| |$|) + (PROG (#1=#:G102544 |a| #2=#:G102545) + (RETURN + (SEQ + (SPADCALL + (CONS + (SPADCALL (SPADCALL "construct" (QREFELT |$| 38)) (QREFELT |$| 40)) + (PROGN + (LETT #1# NIL |LIST;convert;$If;13|) + (SEQ + (LETT |a| NIL |LIST;convert;$If;13|) + (LETT #2# |x| |LIST;convert;$If;13|) + G190 + (COND + ((OR + (ATOM #2#) + (PROGN (LETT |a| (CAR #2#) |LIST;convert;$If;13|) NIL)) + (GO G191))) + (SEQ + (EXIT + (LETT #1# + (CONS (SPADCALL |a| (QREFELT |$| 41)) #1#) + |LIST;convert;$If;13|))) + (LETT #2# (CDR #2#) |LIST;convert;$If;13|) + (GO G190) + G191 + (EXIT (NREVERSE0 #1#))))) + (QREFELT |$| 43)))))) + +(DEFUN |List| (#1=#:G102555) + (PROG NIL + (RETURN + (PROG (#2=#:G102556) + (RETURN + (COND + ((LETT #2# + (|lassocShiftWithFunction| + (LIST (|devaluate| #1#)) + (HGET |$ConstructorCache| (QUOTE |List|)) + (QUOTE |domainEqualList|)) + |List|) + (|CDRwithIncrement| #2#)) + ((QUOTE T) + (|UNWIND-PROTECT| + (PROG1 (|List;| #1#) (LETT #2# T |List|)) + (COND ((NOT #2#) (HREM |$ConstructorCache| (QUOTE |List|)))))))))))) + +(DEFUN |List;| (|#1|) + (PROG (|DV$1| |dv$| |$| #1=#:G102554 |pv$|) + (RETURN + (PROGN + (LETT |DV$1| (|devaluate| |#1|) . #2=(|List|)) + (LETT |dv$| (LIST (QUOTE |List|) |DV$1|) . #2#) + (LETT |$| (GETREFV 62) . #2#) + (QSETREFV |$| 0 |dv$|) + (QSETREFV |$| 3 + (LETT |pv$| + (|buildPredVector| 0 0 + (LIST + (|HasCategory| |#1| (QUOTE (|SetCategory|))) + (|HasCategory| |#1| (QUOTE (|ConvertibleTo| (|InputForm|)))) + (LETT #1# (|HasCategory| |#1| (QUOTE (|OrderedSet|))) . #2#) + (OR #1# (|HasCategory| |#1| (QUOTE (|SetCategory|)))) + (|HasCategory| |#1| (QUOTE (|OpenMath|))) + (|HasCategory| (|Integer|) (QUOTE (|OrderedSet|))) + (AND + (|HasCategory| |#1| (LIST (QUOTE |Evalable|) (|devaluate| |#1|))) + (|HasCategory| |#1| (QUOTE (|SetCategory|)))) + (OR + (AND + (|HasCategory| |#1| (LIST (QUOTE |Evalable|) (|devaluate| |#1|))) + #1#) + (AND + (|HasCategory| |#1| (LIST (QUOTE |Evalable|) (|devaluate| |#1|))) + (|HasCategory| |#1| (QUOTE (|SetCategory|))))))) + . #2#)) + (|haddProp| |$ConstructorCache| (QUOTE |List|) (LIST |DV$1|) (CONS 1 |$|)) + (|stuffDomainSlots| |$|) + (QSETREFV |$| 6 |#1|) + (COND + ((|testBitVector| |pv$| 5) + (PROGN + (QSETREFV |$| 25 (CONS (|dispatchFunction| |LIST;OMwrite;$S;6|) |$|)) + (QSETREFV |$| 26 (CONS (|dispatchFunction| |LIST;OMwrite;$BS;7|) |$|)) + (QSETREFV |$| 27 (CONS (|dispatchFunction| |LIST;OMwrite;Omd$V;8|) |$|)) + (QSETREFV |$| 28 + (CONS (|dispatchFunction| |LIST;OMwrite;Omd$BV;9|) |$|))))) + (COND + ((|testBitVector| |pv$| 1) + (PROGN + (QSETREFV |$| 31 + (CONS (|dispatchFunction| |LIST;setUnion;3$;10|) |$|)) + (QSETREFV |$| 33 + (CONS (|dispatchFunction| |LIST;setIntersection;3$;11|) |$|)) + (QSETREFV |$| 36 + (CONS (|dispatchFunction| |LIST;setDifference;3$;12|) |$|))))) + (COND + ((|testBitVector| |pv$| 2) + (QSETREFV |$| 44 (CONS (|dispatchFunction| |LIST;convert;$If;13|) |$|)))) + |$|)))) + +(MAKEPROP + (QUOTE |List|) + (QUOTE |infovec|) + (LIST + (QUOTE #( + NIL NIL NIL NIL NIL (|IndexedList| 6 (NRTEVAL 1)) (|local| |#1|) + |LIST;nil;$;1| (|Boolean|) |LIST;null;$B;2| |LIST;cons;S2$;3| + |LIST;append;3$;4| (|Void|) (|OpenMathDevice|) (0 . |OMputApp|) + (|String|) (5 . |OMputSymbol|) (12 . |OMwrite|) (19 . |OMputEndApp|) + (|OpenMathEncoding|) (24 . |OMencodingXML|) (28 . |OMopenString|) + (34 . |OMputObject|) (39 . |OMputEndObject|) (44 . |OMclose|) + (49 . |OMwrite|) (54 . |OMwrite|) (60 . |OMwrite|) (66 . |OMwrite|) + (73 . |concat|) (79 . |removeDuplicates|) (84 . |setUnion|) + (90 . |member?|) (96 . |setIntersection|) (|Integer|) (102 . |elt|) + (108 . |setDifference|) (|Symbol|) (114 . |coerce|) (|InputForm|) + (119 . |convert|) (124 . |convert|) (|List| |$|) (129 . |convert|) + (134 . |convert|) (|Mapping| 6 6 6) (|NonNegativeInteger|) + (|List| 6) (|List| 49) (|Equation| 6) (|Mapping| 8 6) + (|Mapping| 8 6 6) (|UniversalSegment| 34) (QUOTE "last") + (QUOTE "rest") (QUOTE "first") (QUOTE "value") (|Mapping| 6 6) + (|SingleInteger|) (|OutputForm|) (|List| 34) (|Union| 6 (QUOTE "failed")))) + (QUOTE #(|setUnion| 139 |setIntersection| 145 |setDifference| 151 + |removeDuplicates| 157 |null| 162 |nil| 167 |member?| 171 |elt| 177 + |convert| 183 |cons| 188 |concat| 194 |append| 200 |OMwrite| 206)) + (QUOTE ((|shallowlyMutable| . 0) (|finiteAggregate| . 0))) + (CONS + (|makeByteWordVec2| 8 (QUOTE (0 0 0 0 0 0 0 0 0 0 3 0 0 8 4 0 0 8 1 2 4 5))) + (CONS (QUOTE #( + |ListAggregate&| |StreamAggregate&| |ExtensibleLinearAggregate&| + |FiniteLinearAggregate&| |UnaryRecursiveAggregate&| |LinearAggregate&| + |RecursiveAggregate&| |IndexedAggregate&| |Collection&| + |HomogeneousAggregate&| |OrderedSet&| |Aggregate&| |EltableAggregate&| + |Evalable&| |SetCategory&| NIL NIL |InnerEvalable&| NIL NIL + |BasicType&| NIL)) + (CONS + (QUOTE #((|ListAggregate| 6) (|StreamAggregate| 6) + (|ExtensibleLinearAggregate| 6) (|FiniteLinearAggregate| 6) + (|UnaryRecursiveAggregate| 6) (|LinearAggregate| 6) + (|RecursiveAggregate| 6) (|IndexedAggregate| 34 6) (|Collection| 6) + (|HomogeneousAggregate| 6) (|OrderedSet|) (|Aggregate|) + (|EltableAggregate| 34 6) (|Evalable| 6) (|SetCategory|) + (|Type|) (|Eltable| 34 6) (|InnerEvalable| 6 6) (|CoercibleTo| 59) + (|ConvertibleTo| 39) (|BasicType|) (|OpenMath|))) + (|makeByteWordVec2| 44 + (QUOTE ( + 1 13 12 0 14 3 13 12 0 15 15 16 3 6 12 13 0 8 17 1 13 12 0 18 0 + 19 0 20 2 13 0 15 19 21 1 13 12 0 22 1 13 12 0 23 1 13 12 0 24 1 0 15 + 0 25 2 0 15 0 8 26 2 0 12 13 0 27 3 0 12 13 0 8 28 2 0 0 0 0 29 1 0 0 + 0 30 2 0 0 0 0 31 2 0 8 6 0 32 2 0 0 0 0 33 2 0 6 0 34 35 2 0 0 0 0 36 + 1 37 0 15 38 1 39 0 37 40 1 6 39 0 41 1 39 0 42 43 1 0 39 0 44 2 1 0 0 + 0 31 2 1 0 0 0 33 2 1 0 0 0 36 1 1 0 0 30 1 0 8 0 9 0 0 0 7 2 1 8 6 0 + 32 2 0 6 0 34 35 1 2 39 0 44 2 0 0 6 0 10 2 0 0 0 0 29 2 0 0 0 0 11 3 + 5 12 13 0 8 28 2 5 12 13 0 27 1 5 15 0 25 2 5 15 0 8 26)))))) + (QUOTE |lookupIncomplete|))) +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{NNI.lsp BOOTSTRAP} +{\bf NNI} depends on itself. We need to break this cycle to build +the algebra. So we keep a cached copy of the translated {\bf NNI} +category which we can write into the {\bf MID} directory. We compile +the lisp code and copy the {\bf NNI.o} file to the {\bf OUT} directory. +This is eventually forcibly replaced by a recompiled version. + +Note that this code is not included in the generated catdef.spad file. + +<>= + +(|/VERSIONCHECK| 2) + +(SETQ |$CategoryFrame| + (|put| + #1=(QUOTE |NonNegativeInteger|) + (QUOTE |SuperDomain|) + #2=(QUOTE (|Integer|)) + (|put| + #2# + #3=(QUOTE |SubDomain|) + (CONS + (QUOTE + (|NonNegativeInteger| + COND ((|<| |#1| 0) (QUOTE NIL)) ((QUOTE T) (QUOTE T)))) + (DELASC #1# (|get| #2# #3# |$CategoryFrame|))) + |$CategoryFrame|))) + +(PUT + (QUOTE |NNI;sup;3$;1|) + (QUOTE |SPADreplace|) + (QUOTE MAX)) + +(DEFUN |NNI;sup;3$;1| (|x| |y| |$|) (MAX |x| |y|)) + +(PUT + (QUOTE |NNI;shift;$I$;2|) + (QUOTE |SPADreplace|) + (QUOTE ASH)) + +(DEFUN |NNI;shift;$I$;2| (|x| |n| |$|) (ASH |x| |n|)) + +(DEFUN |NNI;subtractIfCan;2$U;3| (|x| |y| |$|) + (PROG (|c|) + (RETURN + (SEQ + (LETT |c| (|-| |x| |y|) |NNI;subtractIfCan;2$U;3|) + (EXIT + (COND + ((|<| |c| 0) (CONS 1 "failed")) + ((QUOTE T) (CONS 0 |c|)))))))) + +(DEFUN |NonNegativeInteger| NIL + (PROG NIL + (RETURN + (PROG (#1=#:G96708) + (RETURN + (COND + ((LETT #1# + (HGET |$ConstructorCache| (QUOTE |NonNegativeInteger|)) + |NonNegativeInteger|) + (|CDRwithIncrement| (CDAR #1#))) + ((QUOTE T) + (|UNWIND-PROTECT| + (PROG1 + (CDDAR + (HPUT + |$ConstructorCache| + (QUOTE |NonNegativeInteger|) + (LIST (CONS NIL (CONS 1 (|NonNegativeInteger;|)))))) + (LETT #1# T |NonNegativeInteger|)) + (COND + ((NOT #1#) + (HREM + |$ConstructorCache| + (QUOTE |NonNegativeInteger|)))))))))))) + +(DEFUN |NonNegativeInteger;| NIL + (PROG (|dv$| |$| |pv$|) + (RETURN + (PROGN + (LETT |dv$| (QUOTE (|NonNegativeInteger|)) . #1=(|NonNegativeInteger|)) + (LETT |$| (GETREFV 17) . #1#) + (QSETREFV |$| 0 |dv$|) + (QSETREFV |$| 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#)) + (|haddProp| + |$ConstructorCache| + (QUOTE |NonNegativeInteger|) + NIL + (CONS 1 |$|)) + (|stuffDomainSlots| |$|) |$|)))) + +(MAKEPROP + (QUOTE |NonNegativeInteger|) + (QUOTE |infovec|) + (LIST + (QUOTE + #(NIL NIL NIL NIL NIL + (|Integer|) + |NNI;sup;3$;1| + |NNI;shift;$I$;2| + (|Union| |$| (QUOTE "failed")) + |NNI;subtractIfCan;2$U;3| + (|Record| (|:| |quotient| |$|) (|:| |remainder| |$|)) + (|PositiveInteger|) + (|Boolean|) + (|NonNegativeInteger|) + (|SingleInteger|) + (|String|) + (|OutputForm|))) + (QUOTE + #(|~=| 0 |zero?| 6 |sup| 11 |subtractIfCan| 17 |shift| 23 |sample| 29 + |rem| 33 |recip| 39 |random| 44 |quo| 49 |one?| 55 |min| 60 |max| 66 + |latex| 72 |hash| 77 |gcd| 82 |exquo| 88 |divide| 94 |coerce| 100 + |^| 105 |Zero| 117 |One| 121 |>=| 125 |>| 131 |=| 137 |<=| 143 + |<| 149 |+| 155 |**| 161 |*| 173)) + (QUOTE (((|commutative| "*") . 0))) + (CONS + (|makeByteWordVec2| 1 (QUOTE (0 0 0 0 0 0 0 0 0 0 0 0 0))) + (CONS + (QUOTE + #(NIL NIL NIL NIL NIL + |Monoid&| + |AbelianMonoid&| + |OrderedSet&| + |SemiGroup&| + |AbelianSemiGroup&| + |SetCategory&| + |BasicType&| + NIL)) + (CONS + (QUOTE + #((|OrderedAbelianMonoidSup|) + (|OrderedCancellationAbelianMonoid|) + (|OrderedAbelianMonoid|) + (|OrderedAbelianSemiGroup|) + (|CancellationAbelianMonoid|) + (|Monoid|) + (|AbelianMonoid|) + (|OrderedSet|) + (|SemiGroup|) + (|AbelianSemiGroup|) + (|SetCategory|) + (|BasicType|) + (|CoercibleTo| 16))) + (|makeByteWordVec2| 16 + (QUOTE + (2 0 12 0 0 1 1 0 12 0 1 2 0 0 0 0 6 2 0 8 0 0 9 2 0 0 0 5 7 0 0 + 0 1 2 0 0 0 0 1 1 0 8 0 1 1 0 0 0 1 2 0 0 0 0 1 1 0 12 0 1 2 0 + 0 0 0 1 2 0 0 0 0 1 1 0 15 0 1 1 0 14 0 1 2 0 0 0 0 1 2 0 8 0 0 + 1 2 0 10 0 0 1 1 0 16 0 1 2 0 0 0 11 1 2 0 0 0 13 1 0 0 0 1 0 0 + 0 1 2 0 12 0 0 1 2 0 12 0 0 1 2 0 12 0 0 1 2 0 12 0 0 1 2 0 12 + 0 0 1 2 0 0 0 0 1 2 0 0 0 11 1 2 0 0 0 13 1 2 0 0 0 0 1 2 0 0 + 11 0 1 2 0 0 13 0 1)))))) + (QUOTE |lookupComplete|))) + +(MAKEPROP (QUOTE |NonNegativeInteger|) (QUOTE NILADIC) T) + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{PI.lsp BOOTSTRAP} +{\bf PI} depends on itself. We need to break this cycle to build +the algebra. So we keep a cached copy of the translated {\bf PI} +category which we can write into the {\bf MID} directory. We compile +the lisp code and copy the {\bf PI.o} file to the {\bf OUT} directory. +This is eventually forcibly replaced by a recompiled version. + +Note that this code is not included in the generated catdef.spad file. + +<>= + +(|/VERSIONCHECK| 2) + +(SETQ |$CategoryFrame| + (|put| + #1=(QUOTE |PositiveInteger|) + (QUOTE |SuperDomain|) + #2=(QUOTE (|NonNegativeInteger|)) + (|put| + #2# + #3=(QUOTE |SubDomain|) + (CONS + (QUOTE (|PositiveInteger| |<| 0 |#1|)) + (DELASC #1# (|get| #2# #3# |$CategoryFrame|))) + |$CategoryFrame|))) + +(DEFUN |PositiveInteger| NIL + (PROG NIL + (RETURN + (PROG (#1=#:G96739) + (RETURN + (COND + ((LETT #1# + (HGET |$ConstructorCache| (QUOTE |PositiveInteger|)) + |PositiveInteger|) + (|CDRwithIncrement| (CDAR #1#))) + ((QUOTE T) + (|UNWIND-PROTECT| + (PROG1 + (CDDAR + (HPUT |$ConstructorCache| + (QUOTE |PositiveInteger|) + (LIST (CONS NIL (CONS 1 (|PositiveInteger;|)))))) + (LETT #1# T |PositiveInteger|)) + (COND + ((NOT #1#) + (HREM + |$ConstructorCache| + (QUOTE |PositiveInteger|)))))))))))) + +(DEFUN |PositiveInteger;| NIL + (PROG (|dv$| |$| |pv$|) + (RETURN + (PROGN + (LETT |dv$| (QUOTE (|PositiveInteger|)) . #1=(|PositiveInteger|)) + (LETT |$| (GETREFV 12) . #1#) + (QSETREFV |$| 0 |dv$|) + (QSETREFV |$| 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#)) + (|haddProp| + |$ConstructorCache| (QUOTE |PositiveInteger|) NIL (CONS 1 |$|)) + (|stuffDomainSlots| |$|) + |$|)))) + +(MAKEPROP + (QUOTE |PositiveInteger|) + (QUOTE |infovec|) + (LIST + (QUOTE + #(NIL NIL NIL NIL NIL + (|NonNegativeInteger|) + (|PositiveInteger|) + (|Boolean|) + (|Union| |$| (QUOTE "failed")) + (|SingleInteger|) + (|String|) + (|OutputForm|))) + (QUOTE #(|~=| 0 |sample| 6 |recip| 10 |one?| 15 |min| 20 |max| 26 + |latex| 32 |hash| 37 |gcd| 42 |coerce| 48 |^| 53 |One| 65 + |>=| 69 |>| 75 |=| 81 |<=| 87 |<| 93 |+| 99 |**| 105 |*| 117)) + (QUOTE (((|commutative| "*") . 0))) + (CONS + (|makeByteWordVec2| 1 (QUOTE (0 0 0 0 0 0 0))) + (CONS + (QUOTE #(|Monoid&| |AbelianSemiGroup&| |SemiGroup&| |OrderedSet&| + |SetCategory&| |BasicType&| NIL)) + (CONS + (QUOTE #( + (|Monoid|) + (|AbelianSemiGroup|) + (|SemiGroup|) + (|OrderedSet|) + (|SetCategory|) + (|BasicType|) + (|CoercibleTo| 11))) + (|makeByteWordVec2| 11 + (QUOTE (2 0 7 0 0 1 0 0 0 1 1 0 8 0 1 1 0 7 0 1 2 0 0 0 0 1 2 0 0 0 + 0 1 1 0 10 0 1 1 0 9 0 1 2 0 0 0 0 1 1 0 11 0 1 2 0 0 0 6 1 + 2 0 0 0 5 1 0 0 0 1 2 0 7 0 0 1 2 0 7 0 0 1 2 0 7 0 0 1 2 0 + 7 0 0 1 2 0 7 0 0 1 2 0 0 0 0 1 2 0 0 0 6 1 2 0 0 0 5 1 2 0 + 0 0 0 1 2 0 0 6 0 1)))))) + (QUOTE |lookupComplete|))) + +(MAKEPROP (QUOTE |PositiveInteger|) (QUOTE NILADIC) T) + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{PRIMARR.lsp BOOTSTRAP} {\bf PRIMARR} depends on itself. We need to break this cycle to build the algebra. So we keep a @@ -34592,6 +43389,9 @@ Note that this code is not included in the generated catdef.spad file. <> <> <> +<> +<> +<> <> <> @@ -34603,6 +43403,7 @@ Note that this code is not included in the generated catdef.spad file. <> <> <> +<> <> <> @@ -34611,6 +43412,7 @@ Note that this code is not included in the generated catdef.spad file. <> <> <> +<> <> <> <> @@ -34676,24 +43478,44 @@ Note that this code is not included in the generated catdef.spad file. <> <> +<> +<> +<> + <> +<> +<> <> <> <> +<> +<> +<> +<> +<> <> +<> <> <> +<> <> <> <> <> +<> <> <> +<> +<> +<> <> +<> <> +<> +<> <> <> <> @@ -34701,10 +43523,11 @@ Note that this code is not included in the generated catdef.spad file. <> <> <> +<> <> +<> <> - <> <> <> @@ -34713,6 +43536,7 @@ Note that this code is not included in the generated catdef.spad file. <> <> <> +<> <> <> <> @@ -34720,6 +43544,8 @@ Note that this code is not included in the generated catdef.spad file. <> <> <> +<> +<> <> <> @@ -34729,12 +43555,14 @@ Note that this code is not included in the generated catdef.spad file. <> <> <> +<> <> <> <> <> <> +<> <> <> <> @@ -34745,6 +43573,8 @@ Note that this code is not included in the generated catdef.spad file. <> <> +<> +<> <> @ diff --git a/books/ps/v103associatedjordanalgebra.ps b/books/ps/v103associatedjordanalgebra.ps new file mode 100644 index 0000000..14867ee --- /dev/null +++ b/books/ps/v103associatedjordanalgebra.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 204 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 204 80 +%%PageOrientation: Portrait +gsave +36 36 168 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +166 42 lineto +166 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +166 42 lineto +166 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% AssociatedJordanAlgebra +[ /Rect [ 0 0 160 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=JORDAN) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 160 36 moveto +0 36 lineto +0 0 lineto +160 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 160 36 moveto +0 36 lineto +0 0 lineto +160 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +7 13 moveto +(AssociatedJordanAlgebra) +[10.08 5.52 5.52 6.96 6.24 3.84 6.24 3.84 6.24 6.96 5.52 6.96 4.56 6.96 6.24 6.96 10.08 3.84 6.72 6.24 6.96 4.8 6.24] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103associatedliealgebra.ps b/books/ps/v103associatedliealgebra.ps new file mode 100644 index 0000000..c5677b8 --- /dev/null +++ b/books/ps/v103associatedliealgebra.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 186 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 186 80 +%%PageOrientation: Portrait +gsave +36 36 150 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +148 42 lineto +148 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +148 42 lineto +148 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% AssociatedLieAlgebra +[ /Rect [ 0 0 142 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=LIE) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 142 36 moveto +0 36 lineto +0 0 lineto +142 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 142 36 moveto +0 36 lineto +0 0 lineto +142 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +7 13 moveto +(AssociatedLieAlgebra) +[10.08 5.52 5.52 6.96 6.24 3.84 6.24 3.84 6.24 6.96 8.64 3.84 6.24 10.08 3.84 6.72 6.24 6.96 4.8 6.24] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103associationlist.ps b/books/ps/v103associationlist.ps new file mode 100644 index 0000000..8f3a26f --- /dev/null +++ b/books/ps/v103associationlist.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 148 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 148 80 +%%PageOrientation: Portrait +gsave +36 36 112 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +110 42 lineto +110 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +110 42 lineto +110 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% AssociationList +[ /Rect [ 0 0 104 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=ALIST) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 104 36 moveto +0 36 lineto +0 0 lineto +104 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 104 36 moveto +0 36 lineto +0 0 lineto +104 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +7 13 moveto +(AssociationList) +[10.08 5.52 5.52 6.96 6.24 3.84 6.24 3.84 3.84 6.96 6.96 8.64 3.84 5.28 3.84] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103complex.ps b/books/ps/v103complex.ps new file mode 100644 index 0000000..6e3f4a2 --- /dev/null +++ b/books/ps/v103complex.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 110 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 110 80 +%%PageOrientation: Portrait +gsave +36 36 74 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +72 42 lineto +72 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +72 42 lineto +72 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% Complex +[ /Rect [ 0 0 66 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=COMPLEX) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 66 36 moveto +0 36 lineto +0 0 lineto +66 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 66 36 moveto +0 36 lineto +0 0 lineto +66 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +7 13 moveto +(Complex) +[9.36 6.96 10.56 6.96 3.84 5.76 6.96] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103distributedmultivariatepolynomial.ps b/books/ps/v103distributedmultivariatepolynomial.ps new file mode 100644 index 0000000..bd7968d --- /dev/null +++ b/books/ps/v103distributedmultivariatepolynomial.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 256 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 256 80 +%%PageOrientation: Portrait +gsave +36 36 220 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +218 42 lineto +218 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +218 42 lineto +218 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% DistributedMultivariatePolynomial +[ /Rect [ 0 0 212 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=DMP) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 212 36 moveto +0 36 lineto +0 0 lineto +212 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 212 36 moveto +0 36 lineto +0 0 lineto +212 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +7 13 moveto +(DistributedMultivariatePolynomial) +[10.08 3.84 5.28 3.84 5.04 3.84 6.96 6.96 3.84 6.24 6.96 12.48 6.96 3.84 3.84 3.84 6.72 6.24 5.04 3.84 6.24 3.84 6.24 7.44 6.96 3.6 6.96 6.96 6.96 10.8 3.84 6.24 3.84] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103generaldistributedmultivariatepolynomial.ps b/books/ps/v103generaldistributedmultivariatepolynomial.ps new file mode 100644 index 0000000..5557aca --- /dev/null +++ b/books/ps/v103generaldistributedmultivariatepolynomial.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 300 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 300 80 +%%PageOrientation: Portrait +gsave +36 36 264 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +262 42 lineto +262 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +262 42 lineto +262 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% GeneralDistributedMultivariatePolynomial +[ /Rect [ 0 0 256 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=GDMP) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 256 36 moveto +0 36 lineto +0 0 lineto +256 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 256 36 moveto +0 36 lineto +0 0 lineto +256 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +7 13 moveto +(GeneralDistributedMultivariatePolynomial) +[10.08 6.24 6.96 6.24 4.8 6.24 3.84 10.08 3.84 5.28 3.84 5.04 3.84 6.96 6.96 3.84 6.24 6.96 12.48 6.96 3.84 3.84 3.84 6.72 6.24 5.04 3.84 6.24 3.84 6.24 7.44 6.96 3.6 6.96 6.96 6.96 10.8 3.84 6.24 3.84] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103generalunivariatepowerseries.ps b/books/ps/v103generalunivariatepowerseries.ps new file mode 100644 index 0000000..c7493a9 --- /dev/null +++ b/books/ps/v103generalunivariatepowerseries.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 232 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 232 80 +%%PageOrientation: Portrait +gsave +36 36 196 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +194 42 lineto +194 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +194 42 lineto +194 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% GeneralUnivariatePowerSeries +[ /Rect [ 0 0 188 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=GSERIES) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 188 36 moveto +0 36 lineto +0 0 lineto +188 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 188 36 moveto +0 36 lineto +0 0 lineto +188 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +7 13 moveto +(GeneralUnivariatePowerSeries) +[10.08 6.24 6.96 6.24 4.8 6.24 3.84 9.6 6.96 3.84 6.72 6.24 5.04 3.84 6.24 3.84 6.24 7.44 6.48 9.6 6.24 4.8 7.68 6.24 5.04 3.84 6.24 5.52] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103genericnonassociativealgebra.ps b/books/ps/v103genericnonassociativealgebra.ps new file mode 100644 index 0000000..9fd1a85 --- /dev/null +++ b/books/ps/v103genericnonassociativealgebra.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 238 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 238 80 +%%PageOrientation: Portrait +gsave +36 36 202 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +200 42 lineto +200 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +200 42 lineto +200 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% GenericNonAssociativeAlgebra +[ /Rect [ 0 0 194 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=GCNAALG) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 194 36 moveto +0 36 lineto +0 0 lineto +194 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 194 36 moveto +0 36 lineto +0 0 lineto +194 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +7 13 moveto +(GenericNonAssociativeAlgebra) +[10.08 6.24 6.96 6.24 5.04 3.84 6.24 9.84 6.96 6.96 10.08 5.52 5.52 6.96 6.24 3.84 6.24 3.84 3.84 6.48 6.24 10.08 3.84 6.72 6.24 6.96 4.8 6.24] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103homogeneousdirectproduct.ps b/books/ps/v103homogeneousdirectproduct.ps new file mode 100644 index 0000000..90b86a5 --- /dev/null +++ b/books/ps/v103homogeneousdirectproduct.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 220 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 220 80 +%%PageOrientation: Portrait +gsave +36 36 184 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +182 42 lineto +182 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +182 42 lineto +182 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% HomogeneousDirectProduct +[ /Rect [ 0 0 176 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=HDP) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 176 36 moveto +0 36 lineto +0 0 lineto +176 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 176 36 moveto +0 36 lineto +0 0 lineto +176 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +7 13 moveto +(HomogeneousDirectProduct) +[10.08 6.96 10.8 6.96 6.72 6.24 6.96 6.24 6.96 6.96 5.52 10.08 3.84 4.8 6.24 6.24 3.84 7.68 4.8 6.96 6.96 6.96 6.24 3.84] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103homogeneousdistributedmultivariatepolynomial.ps b/books/ps/v103homogeneousdistributedmultivariatepolynomial.ps new file mode 100644 index 0000000..c5ff433 --- /dev/null +++ b/books/ps/v103homogeneousdistributedmultivariatepolynomial.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 338 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 338 80 +%%PageOrientation: Portrait +gsave +36 36 302 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +300 42 lineto +300 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +300 42 lineto +300 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% HomogeneousDistributedMultivariatePolynomial +[ /Rect [ 0 0 294 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=HDMP) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 294 36 moveto +0 36 lineto +0 0 lineto +294 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 294 36 moveto +0 36 lineto +0 0 lineto +294 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +8 13 moveto +(HomogeneousDistributedMultivariatePolynomial) +[10.08 6.96 10.8 6.96 6.72 6.24 6.96 6.24 6.96 6.96 5.52 10.08 3.84 5.28 3.84 5.04 3.84 6.96 6.96 3.84 6.24 6.96 12.48 6.96 3.84 3.84 3.84 6.72 6.24 5.04 3.84 6.24 3.84 6.24 7.44 6.96 3.6 6.96 6.96 6.96 10.8 3.84 6.24 3.84] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103indexeddirectproductabeliangroup.ps b/books/ps/v103indexeddirectproductabeliangroup.ps new file mode 100644 index 0000000..b1e5cb5 --- /dev/null +++ b/books/ps/v103indexeddirectproductabeliangroup.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 264 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 264 80 +%%PageOrientation: Portrait +gsave +36 36 228 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +226 42 lineto +226 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +226 42 lineto +226 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% IndexedDirectProductAbelianGroup +[ /Rect [ 0 0 220 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=IDPAG) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 220 36 moveto +0 36 lineto +0 0 lineto +220 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 220 36 moveto +0 36 lineto +0 0 lineto +220 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +8 13 moveto +(IndexedDirectProductAbelianGroup) +[4.56 6.96 6.96 5.76 6.48 6.24 6.96 10.08 3.84 4.8 6.24 6.24 3.84 7.68 4.8 6.96 6.96 6.96 6.24 3.84 9.84 6.96 6.24 3.84 3.84 6.24 6.96 10.08 4.8 6.96 6.96 6.96] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103indexeddirectproductabelianmonoid.ps b/books/ps/v103indexeddirectproductabelianmonoid.ps new file mode 100644 index 0000000..852e704 --- /dev/null +++ b/books/ps/v103indexeddirectproductabelianmonoid.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 272 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 272 80 +%%PageOrientation: Portrait +gsave +36 36 236 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +234 42 lineto +234 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +234 42 lineto +234 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% IndexedDirectProductAbelianMonoid +[ /Rect [ 0 0 228 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=IDPAM) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 228 36 moveto +0 36 lineto +0 0 lineto +228 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 228 36 moveto +0 36 lineto +0 0 lineto +228 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +8 13 moveto +(IndexedDirectProductAbelianMonoid) +[4.56 6.96 6.96 5.76 6.48 6.24 6.96 10.08 3.84 4.8 6.24 6.24 3.84 7.68 4.8 6.96 6.96 6.96 6.24 3.84 9.84 6.96 6.24 3.84 3.84 6.24 6.96 12.48 6.96 6.96 6.96 3.84 6.96] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103indexeddirectproductobject.ps b/books/ps/v103indexeddirectproductobject.ps new file mode 100644 index 0000000..fd093ca --- /dev/null +++ b/books/ps/v103indexeddirectproductobject.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 220 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 220 80 +%%PageOrientation: Portrait +gsave +36 36 184 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +182 42 lineto +182 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +182 42 lineto +182 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% IndexedDirectProductObject +[ /Rect [ 0 0 176 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=IDPO) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 176 36 moveto +0 36 lineto +0 0 lineto +176 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 176 36 moveto +0 36 lineto +0 0 lineto +176 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +7 13 moveto +(IndexedDirectProductObject) +[4.56 6.96 6.96 5.76 6.48 6.24 6.96 10.08 3.84 4.8 6.24 6.24 3.84 7.68 4.8 6.96 6.96 6.96 6.24 3.84 10.08 6.96 3.84 6.24 6.24 3.84] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103indexeddirectproductorderedabelianmonoid.ps b/books/ps/v103indexeddirectproductorderedabelianmonoid.ps new file mode 100644 index 0000000..8c1f08b --- /dev/null +++ b/books/ps/v103indexeddirectproductorderedabelianmonoid.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 318 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 318 80 +%%PageOrientation: Portrait +gsave +36 36 282 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +280 42 lineto +280 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +280 42 lineto +280 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% IndexedDirectProductOrderedAbelianMonoid +[ /Rect [ 0 0 274 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=IDPOAM) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 274 36 moveto +0 36 lineto +0 0 lineto +274 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 274 36 moveto +0 36 lineto +0 0 lineto +274 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +8 13 moveto +(IndexedDirectProductOrderedAbelianMonoid) +[4.56 6.96 6.96 5.76 6.48 6.24 6.96 10.08 3.84 4.8 6.24 6.24 3.84 7.68 4.8 6.96 6.96 6.96 6.24 3.84 10.08 4.56 6.96 6.24 4.8 6.24 6.96 9.84 6.96 6.24 3.84 3.84 6.24 6.96 12.48 6.96 6.96 6.96 3.84 6.96] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103indexeddirectproductorderedabelianmonoidsup.ps b/books/ps/v103indexeddirectproductorderedabelianmonoidsup.ps new file mode 100644 index 0000000..c42b7b1 --- /dev/null +++ b/books/ps/v103indexeddirectproductorderedabelianmonoidsup.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 340 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 340 80 +%%PageOrientation: Portrait +gsave +36 36 304 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +302 42 lineto +302 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +302 42 lineto +302 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% IndexedDirectProductOrderedAbelianMonoidSup +[ /Rect [ 0 0 296 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=IDPOAMS) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 296 36 moveto +0 36 lineto +0 0 lineto +296 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 296 36 moveto +0 36 lineto +0 0 lineto +296 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +8 13 moveto +(IndexedDirectProductOrderedAbelianMonoidSup) +[4.56 6.96 6.96 5.76 6.48 6.24 6.96 10.08 3.84 4.8 6.24 6.24 3.84 7.68 4.8 6.96 6.96 6.96 6.24 3.84 10.08 4.56 6.96 6.24 4.8 6.24 6.96 9.84 6.96 6.24 3.84 3.84 6.24 6.96 12.48 6.96 6.96 6.96 3.84 6.96 7.68 6.96 6.96] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103indexedlist.ps b/books/ps/v103indexedlist.ps new file mode 100644 index 0000000..f9d8e84 --- /dev/null +++ b/books/ps/v103indexedlist.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 126 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 126 80 +%%PageOrientation: Portrait +gsave +36 36 90 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +88 42 lineto +88 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +88 42 lineto +88 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% IndexedList +[ /Rect [ 0 0 82 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=ILIST) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 82 36 moveto +0 36 lineto +0 0 lineto +82 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 82 36 moveto +0 36 lineto +0 0 lineto +82 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +7 13 moveto +(IndexedList) +[4.56 6.96 6.96 5.76 6.48 6.24 6.96 8.64 3.84 5.28 3.84] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103infinitetuple.ps b/books/ps/v103infinitetuple.ps new file mode 100644 index 0000000..2b81bac --- /dev/null +++ b/books/ps/v103infinitetuple.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 134 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 134 80 +%%PageOrientation: Portrait +gsave +36 36 98 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +96 42 lineto +96 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +96 42 lineto +96 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% InfiniteTuple +[ /Rect [ 0 0 90 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=ITUPLE) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 90 36 moveto +0 36 lineto +0 0 lineto +90 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 90 36 moveto +0 36 lineto +0 0 lineto +90 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +8 13 moveto +(InfiniteTuple) +[4.56 6.96 4.8 3.84 6.96 3.84 3.84 6.24 7.44 6.96 6.96 3.84 6.24] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103integer.ps b/books/ps/v103integer.ps new file mode 100644 index 0000000..fed801c --- /dev/null +++ b/books/ps/v103integer.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 100 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 100 80 +%%PageOrientation: Portrait +gsave +36 36 64 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +62 42 lineto +62 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +62 42 lineto +62 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% Integer +[ /Rect [ 0 0 56 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=INT) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 56 36 moveto +0 36 lineto +0 0 lineto +56 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 56 36 moveto +0 36 lineto +0 0 lineto +56 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +7 13 moveto +(Integer) +[4.56 6.96 3.84 6.24 6.72 6.24 4.8] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103integrationresult.ps b/books/ps/v103integrationresult.ps new file mode 100644 index 0000000..525e4a8 --- /dev/null +++ b/books/ps/v103integrationresult.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 158 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 158 80 +%%PageOrientation: Portrait +gsave +36 36 122 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +120 42 lineto +120 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +120 42 lineto +120 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% IntegrationResult +[ /Rect [ 0 0 114 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=IR) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 114 36 moveto +0 36 lineto +0 0 lineto +114 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 114 36 moveto +0 36 lineto +0 0 lineto +114 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +7 13 moveto +(IntegrationResult) +[4.56 6.96 3.84 6.24 7.2 4.8 6.24 3.84 3.84 6.96 6.96 9.12 6.24 5.52 6.96 3.84 3.84] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103interval.ps b/books/ps/v103interval.ps new file mode 100644 index 0000000..b4519d4 --- /dev/null +++ b/books/ps/v103interval.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 104 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 104 80 +%%PageOrientation: Portrait +gsave +36 36 68 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +66 42 lineto +66 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +66 42 lineto +66 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% Interval +[ /Rect [ 0 0 60 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=INTRVL) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 60 36 moveto +0 36 lineto +0 0 lineto +60 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 60 36 moveto +0 36 lineto +0 0 lineto +60 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +7 13 moveto +(Interval) +[4.56 6.96 3.84 6.24 5.04 6.72 6.24 3.84] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103kernel.ps b/books/ps/v103kernel.ps new file mode 100644 index 0000000..20f95c0 --- /dev/null +++ b/books/ps/v103kernel.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 100 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 100 80 +%%PageOrientation: Portrait +gsave +36 36 64 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +62 42 lineto +62 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +62 42 lineto +62 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% Kernel +[ /Rect [ 0 0 56 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=KERNEL) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 56 36 moveto +0 36 lineto +0 0 lineto +56 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 56 36 moveto +0 36 lineto +0 0 lineto +56 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +8 13 moveto +(Kernel) +[9.6 6.24 5.04 6.96 6.24 3.84] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103laurentpolynomial.ps b/books/ps/v103laurentpolynomial.ps new file mode 100644 index 0000000..1b11c60 --- /dev/null +++ b/books/ps/v103laurentpolynomial.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 168 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 168 80 +%%PageOrientation: Portrait +gsave +36 36 132 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +130 42 lineto +130 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +130 42 lineto +130 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% LaurentPolynomial +[ /Rect [ 0 0 124 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=LAUPOL) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 124 36 moveto +0 36 lineto +0 0 lineto +124 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 124 36 moveto +0 36 lineto +0 0 lineto +124 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +8 13 moveto +(LaurentPolynomial) +[8.64 6.24 6.96 4.8 6.24 6.96 3.84 7.44 6.96 3.6 6.96 6.96 6.96 10.8 3.84 6.24 3.84] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103liesquarematrix.ps b/books/ps/v103liesquarematrix.ps new file mode 100644 index 0000000..0fc39ba --- /dev/null +++ b/books/ps/v103liesquarematrix.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 156 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 156 80 +%%PageOrientation: Portrait +gsave +36 36 120 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +118 42 lineto +118 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +118 42 lineto +118 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% LieSquareMatrix +[ /Rect [ 0 0 112 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=LSQM) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 112 36 moveto +0 36 lineto +0 0 lineto +112 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 112 36 moveto +0 36 lineto +0 0 lineto +112 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +8 13 moveto +(LieSquareMatrix) +[8.64 3.84 6.24 7.68 6.72 6.96 6.24 4.8 6.24 12.48 6.24 3.84 5.04 3.84 6.96] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103list.ps b/books/ps/v103list.ps new file mode 100644 index 0000000..5526417 --- /dev/null +++ b/books/ps/v103list.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 98 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 98 80 +%%PageOrientation: Portrait +gsave +36 36 62 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +60 42 lineto +60 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +60 42 lineto +60 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% List +[ /Rect [ 0 0 54 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=LIST) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 54 36 moveto +0 36 lineto +0 0 lineto +54 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 54 36 moveto +0 36 lineto +0 0 lineto +54 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +16 13 moveto +(List) +[8.64 3.84 5.28 3.84] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103makecachableset.ps b/books/ps/v103makecachableset.ps new file mode 100644 index 0000000..1caedc2 --- /dev/null +++ b/books/ps/v103makecachableset.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 162 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 162 80 +%%PageOrientation: Portrait +gsave +36 36 126 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +124 42 lineto +124 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +124 42 lineto +124 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% MakeCachableSet +[ /Rect [ 0 0 118 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=MKCHSET) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 118 36 moveto +0 36 lineto +0 0 lineto +118 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 118 36 moveto +0 36 lineto +0 0 lineto +118 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +7 13 moveto +(MakeCachableSet) +[12.48 6.24 6.72 6.24 9.36 6.24 6 6.96 6.24 6.96 3.84 6.24 7.68 6 3.84] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103nonnegativeinteger.ps b/books/ps/v103nonnegativeinteger.ps new file mode 100644 index 0000000..ce6add6 --- /dev/null +++ b/books/ps/v103nonnegativeinteger.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 174 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 174 80 +%%PageOrientation: Portrait +gsave +36 36 138 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +136 42 lineto +136 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +136 42 lineto +136 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% NonNegativeInteger +[ /Rect [ 0 0 130 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=NNI) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 130 36 moveto +0 36 lineto +0 0 lineto +130 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 130 36 moveto +0 36 lineto +0 0 lineto +130 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +8 13 moveto +(NonNegativeInteger) +[9.84 6.96 6.96 9.84 6.24 6.72 6.24 3.84 3.84 6.48 6.24 4.56 6.96 3.84 6.24 6.72 6.24 4.8] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103ordereddirectproduct.ps b/books/ps/v103ordereddirectproduct.ps new file mode 100644 index 0000000..dd54b91 --- /dev/null +++ b/books/ps/v103ordereddirectproduct.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 184 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 184 80 +%%PageOrientation: Portrait +gsave +36 36 148 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +146 42 lineto +146 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +146 42 lineto +146 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% OrderedDirectProduct +[ /Rect [ 0 0 140 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=ODP) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 140 36 moveto +0 36 lineto +0 0 lineto +140 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 140 36 moveto +0 36 lineto +0 0 lineto +140 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +7 13 moveto +(OrderedDirectProduct) +[10.08 4.56 6.96 6.24 4.8 6.24 6.96 10.08 3.84 4.8 6.24 6.24 3.84 7.68 4.8 6.96 6.96 6.96 6.24 3.84] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103polynomialideals.ps b/books/ps/v103polynomialideals.ps new file mode 100644 index 0000000..bf70e94 --- /dev/null +++ b/books/ps/v103polynomialideals.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 158 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 158 80 +%%PageOrientation: Portrait +gsave +36 36 122 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +120 42 lineto +120 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +120 42 lineto +120 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% PolynomialIdeals +[ /Rect [ 0 0 114 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=IDEAL) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 114 36 moveto +0 36 lineto +0 0 lineto +114 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 114 36 moveto +0 36 lineto +0 0 lineto +114 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +7 13 moveto +(PolynomialIdeals) +[7.44 6.96 3.6 6.96 6.96 6.96 10.8 3.84 6.24 3.84 4.56 6.96 6.24 6.24 3.84 5.52] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103positiveinteger.ps b/books/ps/v103positiveinteger.ps new file mode 100644 index 0000000..fc0f523 --- /dev/null +++ b/books/ps/v103positiveinteger.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 144 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 144 80 +%%PageOrientation: Portrait +gsave +36 36 108 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +106 42 lineto +106 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +106 42 lineto +106 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% PositiveInteger +[ /Rect [ 0 0 100 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=PI) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 100 36 moveto +0 36 lineto +0 0 lineto +100 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 100 36 moveto +0 36 lineto +0 0 lineto +100 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +7 13 moveto +(PositiveInteger) +[7.44 6.96 5.52 3.84 3.84 3.84 6.48 6.24 4.56 6.96 3.84 6.24 6.72 6.24 4.8] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103romannumeral.ps b/books/ps/v103romannumeral.ps new file mode 100644 index 0000000..58bed1f --- /dev/null +++ b/books/ps/v103romannumeral.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 148 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 148 80 +%%PageOrientation: Portrait +gsave +36 36 112 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +110 42 lineto +110 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +110 42 lineto +110 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% RomanNumeral +[ /Rect [ 0 0 104 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=ROMAN) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 104 36 moveto +0 36 lineto +0 0 lineto +104 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 104 36 moveto +0 36 lineto +0 0 lineto +104 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +7 13 moveto +(RomanNumeral) +[8.88 6.96 10.8 6.24 6.96 9.84 6.96 10.8 6.24 4.8 6.24 3.84] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103splithomogeneousdirectproduct.ps b/books/ps/v103splithomogeneousdirectproduct.ps new file mode 100644 index 0000000..63e1087 --- /dev/null +++ b/books/ps/v103splithomogeneousdirectproduct.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 246 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 246 80 +%%PageOrientation: Portrait +gsave +36 36 210 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +208 42 lineto +208 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +208 42 lineto +208 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% SplitHomogeneousDirectProduct +[ /Rect [ 0 0 202 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=SHDP) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 202 36 moveto +0 36 lineto +0 0 lineto +202 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 202 36 moveto +0 36 lineto +0 0 lineto +202 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +8 13 moveto +(SplitHomogeneousDirectProduct) +[7.68 6.96 3.84 3.84 3.84 10.08 6.96 10.8 6.96 6.72 6.24 6.96 6.24 6.96 6.96 5.52 10.08 3.84 4.8 6.24 6.24 3.84 7.68 4.8 6.96 6.96 6.96 6.24 3.84] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103univariatelaurentseries.ps b/books/ps/v103univariatelaurentseries.ps new file mode 100644 index 0000000..3580532 --- /dev/null +++ b/books/ps/v103univariatelaurentseries.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 198 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 198 80 +%%PageOrientation: Portrait +gsave +36 36 162 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +160 42 lineto +160 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +160 42 lineto +160 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% UnivariateLaurentSeries +[ /Rect [ 0 0 154 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=ULS) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 154 36 moveto +0 36 lineto +0 0 lineto +154 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 154 36 moveto +0 36 lineto +0 0 lineto +154 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +8 13 moveto +(UnivariateLaurentSeries) +[9.6 6.96 3.84 6.72 6.24 5.04 3.84 6.24 3.84 6.24 8.64 6.24 6.96 4.8 6.24 6.96 3.84 7.68 6.24 5.04 3.84 6.24 5.52] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/books/ps/v103univariatelaurentseriesconstructor.ps b/books/ps/v103univariatelaurentseriesconstructor.ps new file mode 100644 index 0000000..1782e46 --- /dev/null +++ b/books/ps/v103univariatelaurentseriesconstructor.ps @@ -0,0 +1,248 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.8 (Thu Sep 14 20:34:11 UTC 2006) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: 36 36 264 80 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 264 80 +%%PageOrientation: Portrait +gsave +36 36 228 44 boxprim clip newpath +36 36 translate +0 0 1 beginpage +1.0000 set_scale +4 4 translate 0 rotate +0.167 0.600 1.000 graphcolor +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +226 42 lineto +226 -6 lineto +closepath +fill +0.167 0.600 1.000 graphcolor +newpath -6 -6 moveto +-6 42 lineto +226 42 lineto +226 -6 lineto +closepath +stroke +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font +% UnivariateLaurentSeriesConstructor +[ /Rect [ 0 0 220 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=ULSCONS) >> + /Subtype /Link +/ANN pdfmark +gsave 10 dict begin +filled +0.537 0.247 0.902 nodecolor +0.537 0.247 0.902 nodecolor +newpath 220 36 moveto +0 36 lineto +0 0 lineto +220 0 lineto +closepath +fill +0.537 0.247 0.902 nodecolor +newpath 220 36 moveto +0 36 lineto +0 0 lineto +220 0 lineto +closepath +stroke +gsave 10 dict begin +0.000 0.000 0.000 nodecolor +7 13 moveto +(UnivariateLaurentSeriesConstructor) +[9.6 6.96 3.84 6.72 6.24 5.04 3.84 6.24 3.84 6.24 8.64 6.24 6.96 4.8 6.24 6.96 3.84 7.68 6.24 5.04 3.84 6.24 5.52 9.36 6.96 6.96 5.28 3.84 5.04 6.96 6.24 3.84 6.96 4.8] +xshow +end grestore +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/changelog b/changelog index 352a0cf..7a891b5 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,59 @@ +20081209 tpd books/ps/v103univariatelaurentseriesconstructor.ps added +20081209 tpd books/ps/v103univariatelaurentseries.ps added +20081209 tpd books/ps/v103splithomogeneousdirectproduct.ps added +20081209 tpd books/ps/v103romannumeral.ps added +20081209 tpd books/ps/v103positiveinteger.ps added +20081209 tpd books/ps/v103polynomialideals.ps added +20081209 tpd books/ps/v103ordereddirectproduct.ps added +20081209 tpd books/ps/v103nonnegativeinteger.ps added +20081209 tpd books/ps/v103makecachableset.ps added +20081209 tpd books/ps/v103list.ps added +20081209 tpd books/ps/v103liesquarematrix.ps added +20081209 tpd books/ps/v103laurentpolynomial.ps added +20081209 tpd books/ps/v103kernel.ps added +20081209 tpd books/ps/v103interval.ps added +20081209 tpd books/ps/v103integrationresult.ps added +20081209 tpd books/ps/v103integer.ps added +20081209 tpd books/ps/v103infinitetuple.ps added +20081209 tpd books/ps/v103indexedlist.ps added +20081209 tpd books/ps/v103indexeddirectproductorderedabelianmonoidsup.ps added +20081209 tpd books/ps/v103indexeddirectproductorderedabelianmonoid.ps added +20081209 tpd books/ps/v103indexeddirectproductobject.ps added +20081209 tpd books/ps/v103indexeddirectproductabelianmonoid.ps added +20081209 tpd books/ps/v103indexeddirectproductabeliangroup.ps added +20081209 tpd books/ps/v103homogeneousdistributedmultivariatepolynomial.ps added +20081209 tpd books/ps/v103homogeneousdirectproduct.ps added +20081209 tpd books/ps/v103genericnonassociativealgebra.ps added +20081209 tpd books/ps/v103generalunivariatepowerseries.ps added +20081209 tpd books/ps/v103generaldistributedmultivariatepolynomial.ps added +20081209 tpd books/ps/v103distributedmultivariatepolynomial.ps added +20081209 tpd books/ps/v103complex.ps added +20081209 tpd books/ps/v103associationlist.ps added +20081209 tpd books/ps/v103associatedliealgebra.ps added +20081209 tpd books/ps/v103associatedjordanalgebra.ps added +20081209 tpd src/algebra/list.spad move domains to bookvol10.3 +20081209 tpd src/algebra/Makefile remove lie.spad +20081209 tpd src/algebra/lie.spad removed, move domain to bookvol10.3 +20081209 tpd src/algebra/laurent.spad move domains to bookvol10.3 +20081209 tpd src/algebra/kl.spad move domains to bookvol10.3 +20081209 tpd src/algebra/ituple.spad move domains to bookvol10.3 +20081209 tpd src/algebra/Makefile remove interval.spad +20081209 tpd src/algebra/interval.spad removed, move domain to bookvol10.3 +20081209 tpd src/algebra/integer.spad move domains to bookvol10.3 +20081209 tpd src/algebra/intaux.spad move domain to bookvol10.3 +20081209 tpd src/algebra/Makefile remove indexedp.spad +20081209 tpd src/algebra/indexedp.spad removed, move domain to bookvol10.3 +20081209 tpd src/algebra/Makefile remove ideal.spad +20081209 tpd src/algebra/ideal.spad removed, move domain to bookvol10.3 +20081209 tpd src/algebra/Makefile remove gseries.spad +20081209 tpd src/algebra/gseries.spad removed, move domain to bookvol10.3 +20081209 tpd src/algebra/Makefile remove gpol.spad +20081209 tpd src/algebra/gpol.spad move domain to bookvol10.3 +20081209 tpd src/algebra/generic.spad move domain to bookvol10.3 +20081209 tpd src/algebra/Makefile remove gdpoly.spad +20081209 tpd src/algebra/gdpoly.spad removed, move domains to bookvol10.3 +20081209 tpd src/algebra/gdirprod.spad move domain to bookvol10.3 +20081209 tpd src/algebra/gaussian.spad move domain to bookvol10.3 20081208 tpd src/axiom-website/patches.html 20081208.01.tpd.patch 20081208 tpd src/input/Makefile hyperbolicrules.input added 20081208 tpd src/input/hyperbolicrules.input added diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet index ea5d9cd..f7366c5 100644 --- a/src/algebra/Makefile.pamphlet +++ b/src/algebra/Makefile.pamphlet @@ -338,7 +338,6 @@ LAYER8=\ \subsubsection{Completed spad files} \begin{verbatim} degred.spad.pamphlet (DEGRED) -indexedp.spad.pamphlet (IDPC IDPO IDPAM IDPOAM IDPOAMS IDPAG) product.spad.pamphlet (PRODUCT) retract.spad.pamphlet (RETRACT FRETRCT RATRET) sf.spad.pamphlet (REAL RADCAT RNS FPS DFLOAT) @@ -527,7 +526,6 @@ gdirprod.spad.pamphlet (ORDFUNS ODP HDP SHDP) geneez.spad.pamphlet (GENEEZ) ghensel.spad.pamphlet (GHENSEL) gpgcd.spad.pamphlet (GENPGCD) -gpol.spad.pamphlet (LAUPOL) groebf.spad.pamphlet (GBF) groebsol.spad.pamphlet (GROEBSOL) intrf.spad.pamphlet (SUBRESP MONOTOOL INTHERTR INTTR INTRAT INTRF) @@ -754,8 +752,6 @@ fnla.spad.pamphlet (OSI COMM HB FNLA) fortpak.spad.pamphlet (FCPAK1 NAGSP FORT FOP TEMUTL MCALCFN) fr.spad.pamphlet (FR FRUTIL FR2) f07.spad.pamphlet (NAGF07) -gdpoly.spad.pamphlet (GDMP DMP HDMP) -ideal.spad.pamphlet (IDEAL) intaux.spad.pamphlet (IR IR2) intclos.spad.pamphlet (TRIMAT IBATOOL FFINTBAS WFFINTBS NFINTBAS) integer.spad.pamphlet (INTSLPE INT NNI PI ROMAN) @@ -856,7 +852,6 @@ intalg.spad.pamphlet (DBLRESP INTHERAL INTALG) intef.spad.pamphlet (INTEF) intpm.spad.pamphlet (INTPM) kovacic.spad.pamphlet (KOVACIC) -lie.spad.pamphlet (LIE JORDAN LSQM) liouv.spad.pamphlet (LF) lodof.spad.pamphlet (SETMN PREASSOC ASSOCEQ LODOF) manip.spad.pamphlet (FACTFUNC POLYROOT ALGMANIP SIMPAN TRMANIP) @@ -944,7 +939,6 @@ expr.spad.pamphlet (EXPR PAN2EXPR EXPR2 PMPREDFS PMASSFS PMPRED PMASS HACKPI PICOERCE) expr2ups.spad.pamphlet (EXPR2UPS) fs2expxp.spad.pamphlet (FS2EXPXP) -gseries.spad.pamphlet (GSERIES) integrat.spad.pamphlet (FSCINT FSINT) irexpand.spad.pamphlet (IR2F IRRF2F) laplace.spad.pamphlet (LAPLACE INVLAPLA) @@ -1171,23 +1165,21 @@ SPADFILES= \ ${OUTSRC}/galfact.spad ${OUTSRC}/galfactu.spad ${OUTSRC}/galpolyu.spad \ ${OUTSRC}/galutil.spad ${OUTSRC}/gaussfac.spad ${OUTSRC}/gaussian.spad \ ${OUTSRC}/gbeuclid.spad ${OUTSRC}/gbintern.spad ${OUTSRC}/gb.spad \ - ${OUTSRC}/gdirprod.spad ${OUTSRC}/gdpoly.spad ${OUTSRC}/geneez.spad \ + ${OUTSRC}/gdirprod.spad ${OUTSRC}/geneez.spad \ ${OUTSRC}/generic.spad ${OUTSRC}/genufact.spad ${OUTSRC}/genups.spad \ - ${OUTSRC}/ghensel.spad ${OUTSRC}/gpgcd.spad ${OUTSRC}/gpol.spad \ + ${OUTSRC}/ghensel.spad ${OUTSRC}/gpgcd.spad \ ${OUTSRC}/grdef.spad ${OUTSRC}/groebf.spad ${OUTSRC}/groebsol.spad \ - ${OUTSRC}/gseries.spad \ - ${OUTSRC}/ideal.spad ${OUTSRC}/idecomp.spad ${OUTSRC}/indexedp.spad \ + ${OUTSRC}/idecomp.spad \ ${OUTSRC}/infprod.spad ${OUTSRC}/intaf.spad ${OUTSRC}/intalg.spad \ ${OUTSRC}/intaux.spad ${OUTSRC}/intclos.spad ${OUTSRC}/intef.spad \ ${OUTSRC}/integer.spad ${OUTSRC}/integrat.spad \ - ${OUTSRC}/interval.spad \ ${OUTSRC}/intfact.spad ${OUTSRC}/intpm.spad \ ${OUTSRC}/intrf.spad \ ${OUTSRC}/irexpand.spad \ ${OUTSRC}/irsn.spad ${OUTSRC}/ituple.spad \ ${OUTSRC}/kl.spad ${OUTSRC}/kovacic.spad \ ${OUTSRC}/laplace.spad ${OUTSRC}/laurent.spad ${OUTSRC}/leadcdet.spad \ - ${OUTSRC}/lie.spad ${OUTSRC}/limitps.spad ${OUTSRC}/lindep.spad \ + ${OUTSRC}/limitps.spad ${OUTSRC}/lindep.spad \ ${OUTSRC}/lingrob.spad ${OUTSRC}/liouv.spad ${OUTSRC}/listgcd.spad \ ${OUTSRC}/list.spad ${OUTSRC}/lmdict.spad ${OUTSRC}/lodof.spad \ ${OUTSRC}/lodop.spad ${OUTSRC}/lodo.spad \ @@ -1327,24 +1319,23 @@ DOCFILES= \ ${DOC}/galfact.spad.dvi ${DOC}/galfactu.spad.dvi ${DOC}/galpolyu.spad.dvi \ ${DOC}/galutil.spad.dvi ${DOC}/gaussfac.spad.dvi ${DOC}/gaussian.spad.dvi \ ${DOC}/gbeuclid.spad.dvi ${DOC}/gbintern.spad.dvi ${DOC}/gb.spad.dvi \ - ${DOC}/gdirprod.spad.dvi ${DOC}/gdpoly.spad.dvi ${DOC}/geneez.spad.dvi \ + ${DOC}/gdirprod.spad.dvi ${DOC}/geneez.spad.dvi \ ${DOC}/generic.spad.dvi ${DOC}/genufact.spad.dvi ${DOC}/genups.spad.dvi \ - ${DOC}/ghensel.spad.dvi ${DOC}/gpgcd.spad.dvi ${DOC}/gpol.spad.dvi \ + ${DOC}/ghensel.spad.dvi ${DOC}/gpgcd.spad.dvi \ ${DOC}/grdef.spad.dvi ${DOC}/groebf.spad.dvi ${DOC}/groebsol.spad.dvi \ - ${DOC}/gseries.spad.dvi \ ${DOC}/herm.as.dvi \ - ${DOC}/ideal.spad.dvi ${DOC}/idecomp.spad.dvi ${DOC}/indexedp.spad.dvi \ + ${DOC}/idecomp.spad.dvi \ ${DOC}/infprod.spad.dvi ${DOC}/intaf.spad.dvi ${DOC}/intalg.spad.dvi \ ${DOC}/intaux.spad.dvi ${DOC}/intclos.spad.dvi ${DOC}/intef.spad.dvi \ ${DOC}/integer.spad.dvi ${DOC}/integrat.spad.dvi \ - ${DOC}/interval.as.dvi ${DOC}/interval.spad.dvi \ + ${DOC}/interval.as.dvi \ ${DOC}/intfact.spad.dvi ${DOC}/intpm.spad.dvi \ ${DOC}/intrf.spad.dvi ${DOC}/invnode.as.dvi ${DOC}/invrender.as.dvi \ ${DOC}/invtypes.as.dvi ${DOC}/invutils.as.dvi ${DOC}/irexpand.spad.dvi \ ${DOC}/irsn.spad.dvi ${DOC}/ituple.spad.dvi ${DOC}/iviews.as.dvi \ ${DOC}/kl.spad.dvi ${DOC}/kovacic.spad.dvi \ ${DOC}/laplace.spad.dvi ${DOC}/laurent.spad.dvi ${DOC}/leadcdet.spad.dvi \ - ${DOC}/lie.spad.dvi ${DOC}/limitps.spad.dvi ${DOC}/lindep.spad.dvi \ + ${DOC}/limitps.spad.dvi ${DOC}/lindep.spad.dvi \ ${DOC}/lingrob.spad.dvi ${DOC}/liouv.spad.dvi ${DOC}/listgcd.spad.dvi \ ${DOC}/list.spad.dvi ${DOC}/lmdict.spad.dvi ${DOC}/lodof.spad.dvi \ ${DOC}/lodop.spad.dvi ${DOC}/lodo.spad.dvi \ @@ -2283,15 +2274,15 @@ ${HELP}/DecimalExpansion.help: ${IN}/radix.spad.pamphlet >${INPUT}/DecimalExpansion.input ${HELP}/DistributedMultivariatePolynomial.help: \ - ${IN}/gdpoly.spad.pamphlet + ${BOOKS}/bookvol10.3.pamphlet @echo 7015 create DistributedMultivariatePolynomial.help \ - from ${IN}/gdpoly.spad.pamphlet + from ${BOOKS}/bookvol10.3.pamphlet @${TANGLE} -R"DistributedMultivariatePolynomial.help" \ - ${IN}/gdpoly.spad.pamphlet \ + ${BOOKS}/bookvol10.3.pamphlet \ >${HELP}/DistributedMultivariatePolynomial.help @cp ${HELP}/DistributedMultivariatePolynomial.help ${HELP}/DMP.help @${TANGLE} -R"DistributedMultivariatePolynomial.input" \ - ${IN}/gdpoly.spad.pamphlet \ + ${BOOKS}/bookvol10.3.pamphlet \ >${INPUT}/DistributedMultivariatePolynomial.input ${HELP}/DoubleFloat.help: ${IN}/sf.spad.pamphlet @@ -2394,16 +2385,16 @@ ${HELP}/FullPartialFractionExpansion.help: ${BOOKS}/bookvol10.3.pamphlet >${INPUT}/FullPartialFractionExpansion.input ${HELP}/GeneralDistributedMultivariatePolynomial.help: \ - ${IN}/gdpoly.spad.pamphlet + ${BOOKS}/bookvol10.3.pamphlet @echo 7027 create GeneralDistributedMultivariatePolynomial.help \ - from ${IN}/gdpoly.spad.pamphlet + from ${BOOKS}/bookvol10.3.pamphlet @${TANGLE} -R"GeneralDistributedMultivariatePolynomial.help" \ - ${IN}/gdpoly.spad.pamphlet \ + ${BOOKS}/bookvol10.3.pamphlet \ >${HELP}/GeneralDistributedMultivariatePolynomial.help @cp ${HELP}/GeneralDistributedMultivariatePolynomial.help \ ${HELP}/GDMP.help @${TANGLE} -R"GeneralDistributedMultivariatePolynomial.input" \ - ${IN}/gdpoly.spad.pamphlet \ + ${BOOKS}/bookvol10.3.pamphlet \ >${INPUT}/GeneralDistributedMultivariatePolynomial.input ${HELP}/GeneralSparseTable.help: ${IN}/table.spad.pamphlet @@ -2444,16 +2435,16 @@ ${HELP}/HexadecimalExpansion.help: ${IN}/radix.spad.pamphlet ${IN}/radix.spad.pamphlet >${INPUT}/HexadecimalExpansion.input ${HELP}/HomogeneousDistributedMultivariatePolynomial.help: \ - ${IN}/gdpoly.spad.pamphlet + ${BOOKS}/bookvol10.3.pamphlet @echo 7032 create HomogeneousDistributedMultivariatePolynomial.help \ - from ${IN}/gdpoly.spad.pamphlet + from ${BOOKS}/bookvol10.3.pamphlet @${TANGLE} -R"HomogeneousDistributedMultivariatePolynomial.help" \ - ${IN}/gdpoly.spad.pamphlet \ + ${BOOKS}/bookvol10.3.pamphlet \ >${HELP}/HomogeneousDistributedMultivariatePolynomial.help @cp ${HELP}/HomogeneousDistributedMultivariatePolynomial.help \ ${HELP}/HDMP.help @${TANGLE} -R"HomogeneousDistributedMultivariatePolynomial.input" \ - ${IN}/gdpoly.spad.pamphlet \ + ${BOOKS}/bookvol10.3.pamphlet \ >${INPUT}/HomogeneousDistributedMultivariatePolynomial.input ${HELP}/Integer.help: ${IN}/integer.spad.pamphlet diff --git a/src/algebra/gaussian.spad.pamphlet b/src/algebra/gaussian.spad.pamphlet index c6e05d3..1d804e6 100644 --- a/src/algebra/gaussian.spad.pamphlet +++ b/src/algebra/gaussian.spad.pamphlet @@ -92,373 +92,6 @@ ComplexPatternMatch(R, S, CS) : C == T where patternMatch(makePoly cs, pat, map(makePoly, result))) @ -\section{domain COMPLEX Complex} -<>= --- gaussian.spad.pamphlet Complex.input -)spool Complex.output -)set message test on -)set message auto off -)clear all ---S 1 of 16 -a := complex(4/3,5/2) ---R ---R ---R 4 5 ---R (1) - + - %i ---R 3 2 ---R Type: Complex Fraction Integer ---E 1 - ---S 2 of 16 -b := complex(4/3,-5/2) ---R ---R ---R 4 5 ---R (2) - - - %i ---R 3 2 ---R Type: Complex Fraction Integer ---E 2 - ---S 3 of 16 -a + b ---R ---R ---R 8 ---R (3) - ---R 3 ---R Type: Complex Fraction Integer ---E 3 - ---S 4 of 16 -a - b ---R ---R ---R (4) 5%i ---R Type: Complex Fraction Integer ---E 4 - ---S 5 of 16 -a * b ---R ---R ---R 289 ---R (5) --- ---R 36 ---R Type: Complex Fraction Integer ---E 5 - ---S 6 of 16 -a / b ---R ---R ---R 161 240 ---R (6) - --- + --- %i ---R 289 289 ---R Type: Complex Fraction Integer ---E 6 - ---S 7 of 16 -% :: Fraction Complex Integer ---R ---R ---R - 15 + 8%i ---R (7) ---------- ---R 15 + 8%i ---R Type: Fraction Complex Integer ---E 7 - ---S 8 of 16 -3.4 + 6.7 * %i ---R ---R ---R (8) 3.4 + 6.7 %i ---R Type: Complex Float ---E 8 - ---S 9 of 16 -conjugate a ---R ---R ---R 4 5 ---R (9) - - - %i ---R 3 2 ---R Type: Complex Fraction Integer ---E 9 - ---S 10 of 16 -norm a ---R ---R ---R 289 ---R (10) --- ---R 36 ---R Type: Fraction Integer ---E 10 - ---S 11 of 16 -real a ---R ---R ---R 4 ---R (11) - ---R 3 ---R Type: Fraction Integer ---E 11 - ---S 12 of 16 -imag a ---R ---R ---R 5 ---R (12) - ---R 2 ---R Type: Fraction Integer ---E 12 - ---S 13 of 16 -gcd(13 - 13*%i,31 + 27*%i) ---R ---R ---R (13) 5 + %i ---R Type: Complex Integer ---E 13 - ---S 14 of 16 -lcm(13 - 13*%i,31 + 27*%i) ---R ---R ---R (14) 143 - 39%i ---R Type: Complex Integer ---E 14 - ---S 15 of 16 -factor(13 - 13*%i) ---R ---R ---R (15) - (1 + %i)(2 + 3%i)(3 + 2%i) ---R Type: Factored Complex Integer ---E 15 - ---S 16 of 16 -factor complex(2,0) ---R ---R ---R 2 ---R (16) - %i (1 + %i) ---R Type: Factored Complex Integer ---E 16 -)spool -)lisp (bye) -@ -<>= -==================================================================== -Complex examples -==================================================================== - -The Complex constructor implements complex objects over a commutative -ring R. Typically, the ring R is Integer, Fraction Integer, Float or -DoubleFloat. R can also be a symbolic type, like Polynomial Integer. - -Complex objects are created by the complex operation. - - a := complex(4/3,5/2) - 4 5 - - + - %i - 3 2 - Type: Complex Fraction Integer - - b := complex(4/3,-5/2) - 4 5 - - - - %i - 3 2 - Type: Complex Fraction Integer - -The standard arithmetic operations are available. - - a + b - 8 - - - 3 - Type: Complex Fraction Integer - - a - b - 5%i - Type: Complex Fraction Integer - - a * b - 289 - --- - 36 - Type: Complex Fraction Integer - -If R is a field, you can also divide the complex objects. - - a / b - 161 240 - - --- + --- %i - 289 289 - Type: Complex Fraction Integer - - -We can view the last object as a fraction of complex integers. - - % :: Fraction Complex Integer - - 15 + 8%i - ---------- - 15 + 8%i - Type: Fraction Complex Integer - -The predefined macro %i is defined to be complex(0,1). - - 3.4 + 6.7 * %i - 3.4 + 6.7 %i - Type: Complex Float - -You can also compute the conjugate and norm of a complex number. - - conjugate a - 4 5 - - - - %i - 3 2 - Type: Complex Fraction Integer - - norm a - 289 - --- - 36 - Type: Fraction Integer - -The real and imag operations are provided to extract the real and -imaginary parts, respectively. - - real a - 4 - - - 3 - Type: Fraction Integer - - imag a - 5 - - - 2 - Type: Fraction Integer - -The domain Complex Integer is also called the Gaussian integers. If R -is the integers (or, more generally, a EuclideanDomain), you can compute -greatest common divisors. - - gcd(13 - 13*%i,31 + 27*%i) - 5 + %i - Type: Complex Integer - -You can also compute least common multiples. - - lcm(13 - 13*%i,31 + 27*%i) - 143 - 39%i - Type: Complex Integer - -You can factor Gaussian integers. - - factor(13 - 13*%i) - - (1 + %i)(2 + 3%i)(3 + 2%i) - Type: Factored Complex Integer - - factor complex(2,0) - 2 - - %i (1 + %i) - Type: Factored Complex Integer - -See Also -o )show Complex -o $AXIOM/doc/src/algebra/gaussian.spad.dvi - -@ -<>= -)abbrev domain COMPLEX Complex -++ Author: -++ Date Created: -++ Date Last Updated: -++ Basic Functions: -++ Related Constructors: -++ Also See: -++ AMS Classifications: -++ Keywords: -++ References: -++ Description: -++ \spadtype {Complex(R)} creates the domain of elements of the form -++ \spad{a + b * i} where \spad{a} and b come from the ring R, -++ and i is a new element such that \spad{i**2 = -1}. -Complex(R:CommutativeRing): ComplexCategory(R) with - if R has OpenMath then OpenMath - == add - Rep := Record(real:R, imag:R) - - if R has OpenMath then - writeOMComplex(dev: OpenMathDevice, x: %): Void == - OMputApp(dev) - OMputSymbol(dev, "complex1", "complex__cartesian") - OMwrite(dev, real x) - OMwrite(dev, imag x) - OMputEndApp(dev) - - OMwrite(x: %): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML) - OMputObject(dev) - writeOMComplex(dev, x) - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(x: %, wholeObj: Boolean): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML) - if wholeObj then - OMputObject(dev) - writeOMComplex(dev, x) - if wholeObj then - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(dev: OpenMathDevice, x: %): Void == - OMputObject(dev) - writeOMComplex(dev, x) - OMputEndObject(dev) - - OMwrite(dev: OpenMathDevice, x: %, wholeObj: Boolean): Void == - if wholeObj then - OMputObject(dev) - writeOMComplex(dev, x) - if wholeObj then - OMputEndObject(dev) - - 0 == [0, 0] - 1 == [1, 0] - zero? x == zero?(x.real) and zero?(x.imag) --- one? x == one?(x.real) and zero?(x.imag) - one? x == ((x.real) = 1) and zero?(x.imag) - coerce(r:R):% == [r, 0] - complex(r, i) == [r, i] - real x == x.real - imag x == x.imag - x + y == [x.real + y.real, x.imag + y.imag] - -- by re-defining this here, we save 5 fn calls - x:% * y:% == - [x.real * y.real - x.imag * y.imag, - x.imag * y.real + y.imag * x.real] -- here we save nine! - - - if R has IntegralDomain then - _exquo(x:%, y:%) == -- to correct bad defaulting problem - zero? y.imag => x exquo y.real - x * conjugate(y) exquo norm(y) - -@ \section{package COMPLEX2 ComplexFunctions2} <>= )abbrev package COMPLEX2 ComplexFunctions2 @@ -659,7 +292,6 @@ ComplexIntegerSolveLinearPolynomialEquation(R,CR): C == T <> <> -<> <> <> <> diff --git a/src/algebra/gdirprod.spad.pamphlet b/src/algebra/gdirprod.spad.pamphlet index c12b2fd..8129d50 100644 --- a/src/algebra/gdirprod.spad.pamphlet +++ b/src/algebra/gdirprod.spad.pamphlet @@ -82,130 +82,6 @@ OrderingFunctions(dim,S) : T == C where false @ -\section{domain ODP OrderedDirectProduct} -<>= -)abbrev domain ODP OrderedDirectProduct --- all direct product category domains must be compiled --- without subsumption, set SourceLevelSubset to EQUAL ---)bo $noSubsumption := true - -++ Author: -++ Date Created: -++ Date Last Updated: -++ Basic Functions: -++ Related Constructors: Vector, DirectProduct -++ Also See: HomogeneousDirectProduct, SplitHomogeneousDirectProduct -++ AMS Classifications: -++ Keywords: -++ References: -++ Description: -++ This type represents the finite direct or cartesian product of an -++ underlying ordered component type. The ordering on the type is determined -++ by its third argument which represents the less than function on -++ vectors. This type is a suitable third argument for -++ \spadtype{GeneralDistributedMultivariatePolynomial}. - -OrderedDirectProduct(dim:NonNegativeInteger, - S:OrderedAbelianMonoidSup, - f:(Vector(S),Vector(S))->Boolean):T - == C where - T == DirectProductCategory(dim,S) - C == DirectProduct(dim,S) add - Rep:=Vector(S) - x:% < y:% == f(x::Rep,y::Rep) - -@ -\section{domain HDP HomogeneousDirectProduct} -<>= -)abbrev domain HDP HomogeneousDirectProduct -++ Author: -++ Date Created: -++ Date Last Updated: -++ Basic Functions: -++ Related Constructors: Vector, DirectProduct -++ Also See: OrderedDirectProduct, SplitHomogeneousDirectproduct -++ AMS Classifications: -++ Keywords: -++ References: -++ Description: -++ This type represents the finite direct or cartesian product of an -++ underlying ordered component type. The vectors are ordered first -++ by the sum of their components, and then refined using a reverse -++ lexicographic ordering. This type is a suitable third argument for -++ \spadtype{GeneralDistributedMultivariatePolynomial}. - -HomogeneousDirectProduct(dim,S) : T == C where - dim : NonNegativeInteger - S : OrderedAbelianMonoidSup - - T == DirectProductCategory(dim,S) - C == DirectProduct(dim,S) add - Rep:=Vector(S) - v1:% < v2:% == - -- reverse lexicographical ordering - n1:S:=0 - n2:S:=0 - for i in 1..dim repeat - n1:= n1+qelt(v1,i) - n2:=n2+qelt(v2,i) - n1 true - n2 false - for i in reverse(1..dim) repeat - if qelt(v2,i) < qelt(v1,i) then return true - if qelt(v1,i) < qelt(v2,i) then return false - false - -@ -\section{domain SHDP SplitHomogeneousDirectProduct} -<>= -)abbrev domain SHDP SplitHomogeneousDirectProduct -++ Author: -++ Date Created: -++ Date Last Updated: -++ Basic Functions: -++ Related Constructors: Vector, DirectProduct -++ Also See: OrderedDirectProduct, HomogeneousDirectProduct -++ AMS Classifications: -++ Keywords: -++ References: -++ Description: -++ This type represents the finite direct or cartesian product of an -++ underlying ordered component type. The vectors are ordered as if -++ they were split into two blocks. The dim1 parameter specifies the -++ length of the first block. The ordering is lexicographic between -++ the blocks but acts like \spadtype{HomogeneousDirectProduct} -++ within each block. This type is a suitable third argument for -++ \spadtype{GeneralDistributedMultivariatePolynomial}. - -SplitHomogeneousDirectProduct(dimtot,dim1,S) : T == C where - NNI ==> NonNegativeInteger - dim1,dimtot : NNI - S : OrderedAbelianMonoidSup - - T == DirectProductCategory(dimtot,S) - C == DirectProduct(dimtot,S) add - Rep:=Vector(S) - lessThanRlex(v1:%,v2:%,low:NNI,high:NNI):Boolean == - -- reverse lexicographical ordering - n1:S:=0 - n2:S:=0 - for i in low..high repeat - n1:= n1+qelt(v1,i) - n2:=n2+qelt(v2,i) - n1 true - n2 false - for i in reverse(low..high) repeat - if qelt(v2,i) < qelt(v1,i) then return true - if qelt(v1,i) < qelt(v2,i) then return false - false - - (v1:% < v2:%):Boolean == - lessThanRlex(v1,v2,1,dim1) => true - for i in 1..dim1 repeat - if qelt(v1,i) ^= qelt(v2,i) then return false - lessThanRlex(v1,v2,dim1+1,dimtot) - -@ \section{License} <>= --Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. @@ -243,9 +119,6 @@ SplitHomogeneousDirectProduct(dimtot,dim1,S) : T == C where <> <> -<> -<> -<> @ \eject \begin{thebibliography}{99} diff --git a/src/algebra/gdpoly.spad.pamphlet b/src/algebra/gdpoly.spad.pamphlet deleted file mode 100644 index dd3f68a..0000000 --- a/src/algebra/gdpoly.spad.pamphlet +++ /dev/null @@ -1,1009 +0,0 @@ -\documentclass{article} -\usepackage{axiom} -\begin{document} -\title{\$SPAD/src/algebra gdpoly.spad} -\author{Barry Trager} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject -\section{domain GDMP GeneralDistributedMultivariatePolynomial} -<>= --- gdpoly.spad.pamphlet GeneralDistributedMultivariatePolynomial.input -)spool GeneralDistributedMultivariatePolynomial.output -)set message test on -)set message auto off -)clear all ---S 1 of 10 -(d1,d2,d3) : DMP([z,y,x],FRAC INT) ---R ---R Type: Void ---E 1 - ---S 2 of 10 -d1 := -4*z + 4*y**2*x + 16*x**2 + 1 ---R ---R ---R 2 2 ---R (2) - 4z + 4y x + 16x + 1 ---R Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 2 - ---S 3 of 10 -d2 := 2*z*y**2 + 4*x + 1 ---R ---R ---R 2 ---R (3) 2z y + 4x + 1 ---R Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 3 - ---S 4 of 10 -d3 := 2*z*x**2 - 2*y**2 - x ---R ---R ---R 2 2 ---R (4) 2z x - 2y - x ---R Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 4 - ---S 5 of 10 -groebner [d1,d2,d3] ---R ---R ---R (5) ---R 1568 6 1264 5 6 4 182 3 2047 2 103 2857 ---R [z - ---- x - ---- x + --- x + --- x - ---- x - ---- x - -----, ---R 2745 305 305 549 610 2745 10980 ---R 2 112 6 84 5 1264 4 13 3 84 2 1772 2 ---R y + ---- x - --- x - ---- x - --- x + --- x + ---- x + ----, ---R 2745 305 305 549 305 2745 2745 ---R 7 29 6 17 4 11 3 1 2 15 1 ---R x + -- x - -- x - -- x + -- x + -- x + -] ---R 4 16 8 32 16 4 ---R Type: List DistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 5 - ---S 6 of 10 -(n1,n2,n3) : HDMP([z,y,x],FRAC INT) ---R ---R Type: Void ---E 6 - ---S 7 of 10 -n1 := d1 ---R ---R ---R 2 2 ---R (7) 4y x + 16x - 4z + 1 ---R Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 7 - ---S 8 of 10 -n2 := d2 ---R ---R ---R 2 ---R (8) 2z y + 4x + 1 ---R Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 8 - ---S 9 of 10 -n3 := d3 ---R ---R ---R 2 2 ---R (9) 2z x - 2y - x ---R Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 9 - ---S 10 of 10 -groebner [n1,n2,n3] ---R ---R ---R (10) ---R 4 3 3 2 1 1 4 29 3 1 2 7 9 1 ---R [y + 2x - - x + - z - -, x + -- x - - y - - z x - -- x - -, ---R 2 2 8 4 8 4 16 4 ---R 2 1 2 2 1 2 2 1 ---R z y + 2x + -, y x + 4x - z + -, z x - y - - x, ---R 2 4 2 ---R 2 2 2 1 3 ---R z - 4y + 2x - - z - - x] ---R 4 2 ---RType: List HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 10 -)spool -)lisp (bye) -@ - -<>= -==================================================================== -MultivariatePolynomial -DistributedMultivariatePolynomial -HomogeneousDistributedMultivariatePolynomial -GeneralDistributedMultivariatePolynomial -==================================================================== - -DistributedMultivariatePolynomial which is abbreviated as DMP and -HomogeneousDistributedMultivariatePolynomial, which is abbreviated -as HDMP, are very similar to MultivariatePolynomial except that -they are represented and displayed in a non-recursive manner. - - (d1,d2,d3) : DMP([z,y,x],FRAC INT) - Type: Void - -The constructor DMP orders its monomials lexicographically while -HDMP orders them by total order refined by reverse lexicographic -order. - - d1 := -4*z + 4*y**2*x + 16*x**2 + 1 - 2 2 - - 4z + 4y x + 16x + 1 - Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) - - d2 := 2*z*y**2 + 4*x + 1 - 2 - 2z y + 4x + 1 - Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) - - d3 := 2*z*x**2 - 2*y**2 - x - 2 2 - 2z x - 2y - x - Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) - -These constructors are mostly used in Groebner basis calculations. - - groebner [d1,d2,d3] - 1568 6 1264 5 6 4 182 3 2047 2 103 2857 - [z - ---- x - ---- x + --- x + --- x - ---- x - ---- x - -----, - 2745 305 305 549 610 2745 10980 - 2 112 6 84 5 1264 4 13 3 84 2 1772 2 - y + ---- x - --- x - ---- x - --- x + --- x + ---- x + ----, - 2745 305 305 549 305 2745 2745 - 7 29 6 17 4 11 3 1 2 15 1 - x + -- x - -- x - -- x + -- x + -- x + -] - 4 16 8 32 16 4 - Type: List DistributedMultivariatePolynomial([z,y,x],Fraction Integer) - - (n1,n2,n3) : HDMP([z,y,x],FRAC INT) - Type: Void - - n1 := d1 - 2 2 - 4y x + 16x - 4z + 1 - Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) - - n2 := d2 - 2 - 2z y + 4x + 1 - Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) - - n3 := d3 - 2 2 - 2z x - 2y - x - Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) - -Note that we get a different Groebner basis when we use the HDMP -polynomials, as expected. - - groebner [n1,n2,n3] - 4 3 3 2 1 1 4 29 3 1 2 7 9 1 - [y + 2x - - x + - z - -, x + -- x - - y - - z x - -- x - -, - 2 2 8 4 8 4 16 4 - 2 1 2 2 1 2 2 1 - z y + 2x + -, y x + 4x - z + -, z x - y - - x, - 2 4 2 - 2 2 2 1 3 - z - 4y + 2x - - z - - x] - 4 2 - Type: List HomogeneousDistributedMultivariatePolynomial([z,y,x], - Fraction Integer) - -GeneralDistributedMultivariatePolynomial is somewhat more flexible in -the sense that as well as accepting a list of variables to specify the -variable ordering, it also takes a predicate on exponent vectors to -specify the term ordering. With this polynomial type the user can -experiment with the effect of using completely arbitrary term orderings. -This flexibility is mostly important for algorithms such as Groebner -basis calculations which can be very sensitive to term ordering. - -See Also: -o )help Polynomial -o )help UnivariatePolynomial -o )help MultivariatePolynomial -o )help HomogeneousDistributedMultivariatePolynomial -o )help DistributedMultivariatePolynomial -o )show GeneralDistributedMultivariatePolynomial -o $AXIOM/doc/src/algebra/gdpoly.spad.dvi - -@ -<>= -)abbrev domain GDMP GeneralDistributedMultivariatePolynomial -++ Author: Barry Trager -++ Date Created: -++ Date Last Updated: -++ Basic Functions: Ring, degree, eval, coefficient, monomial, differentiate, -++ resultant, gcd, leadingCoefficient -++ Related Constructors: DistributedMultivariatePolynomial, -++ HomogeneousDistributedMultivariatePolynomial -++ Also See: Polynomial -++ AMS Classifications: -++ Keywords: polynomial, multivariate, distributed -++ References: -++ Description: -++ This type supports distributed multivariate polynomials -++ whose variables are from a user specified list of symbols. -++ The coefficient ring may be non commutative, -++ but the variables are assumed to commute. -++ The term ordering is specified by its third parameter. -++ Suggested types which define term orderings include: \spadtype{DirectProduct}, -++ \spadtype{HomogeneousDirectProduct}, \spadtype{SplitHomogeneousDirectProduct} -++ and finally \spadtype{OrderedDirectProduct} which accepts an arbitrary user -++ function to define a term ordering. - -GeneralDistributedMultivariatePolynomial(vl,R,E): public == private where - vl: List Symbol - R: Ring - E: DirectProductCategory(#vl,NonNegativeInteger) - OV ==> OrderedVariableList(vl) - SUP ==> SparseUnivariatePolynomial - NNI ==> NonNegativeInteger - - public == PolynomialCategory(R,E,OV) with - reorder: (%,List Integer) -> % - ++ reorder(p, perm) applies the permutation perm to the variables - ++ in a polynomial and returns the new correctly ordered polynomial - - private == PolynomialRing(R,E) add - --representations - Term := Record(k:E,c:R) - Rep := List Term - n := #vl - Vec ==> Vector(NonNegativeInteger) - zero?(p : %): Boolean == null(p : Rep) - - totalDegree p == - zero? p => 0 - "max"/[reduce("+",(t.k)::(Vector NNI), 0) for t in p] - - monomial(p:%, v: OV,e: NonNegativeInteger):% == - locv := lookup v - p*monomial(1, - directProduct [if z=locv then e else 0 for z in 1..n]$Vec) - - coerce(v: OV):% == monomial(1,v,1) - - listCoef(p : %): List R == - rec : Term - [rec.c for rec in (p:Rep)] - - mainVariable(p: %) == - zero?(p) => "failed" - for v in vl repeat - vv := variable(v)::OV - if degree(p,vv)>0 then return vv - "failed" - - ground?(p) == mainVariable(p) case "failed" - - retract(p : %): R == - not ground? p => error "not a constant" - leadingCoefficient p - - retractIfCan(p : %): Union(R,"failed") == - ground?(p) => leadingCoefficient p - "failed" - - degree(p: %,v: OV) == degree(univariate(p,v)) - minimumDegree(p: %,v: OV) == minimumDegree(univariate(p,v)) - differentiate(p: %,v: OV) == - multivariate(differentiate(univariate(p,v)),v) - - degree(p: %,lv: List OV) == [degree(p,v) for v in lv] - minimumDegree(p: %,lv: List OV) == [minimumDegree(p,v) for v in lv] - - numberOfMonomials(p:%) == - l : Rep := p : Rep - null(l) => 1 - #l - - monomial?(p : %): Boolean == - l : Rep := p : Rep - null(l) or null rest(l) - - if R has OrderedRing then - maxNorm(p : %): R == - l : List R := nil - r,m : R - m := 0 - for r in listCoef(p) repeat - if r > m then m := r - else if (-r) > m then m := -r - m - - --trailingCoef(p : %) == - -- l : Rep := p : Rep - -- null l => 0 - -- r : Term := last l - -- r.c - - --leadingPrimitiveMonomial(p : %) == - -- ground?(p) => 1$% - -- r : Term := first(p:Rep) - -- r := [r.k,1$R]$Term -- new cell - -- list(r)$Rep :: % - - -- The following 2 defs are inherited from PolynomialRing - - --leadingMonomial(p : %) == - -- ground?(p) => p - -- r : Term := first(p:Rep) - -- r := [r.k,r.c]$Term -- new cell - -- list(r)$Rep :: % - - --reductum(p : %): % == - -- ground? p => 0$% - -- (rest(p:Rep)):% - - if R has Field then - (p : %) / (r : R) == inv(r) * p - - variables(p: %) == - maxdeg:Vector(NonNegativeInteger) := new(n,0) - while not zero?(p) repeat - tdeg := degree p - p := reductum p - for i in 1..n repeat - maxdeg.i := max(maxdeg.i, tdeg.i) - [index(i:PositiveInteger) for i in 1..n | maxdeg.i^=0] - - reorder(p: %,perm: List Integer):% == - #perm ^= n => error "must be a complete permutation of all vars" - q := [[directProduct [term.k.j for j in perm]$Vec,term.c]$Term - for term in p] - sort(#1.k > #2.k,q) - - --coerce(dp:DistributedMultivariatePolynomial(vl,R)):% == - -- q:=dp:List(Term) - -- sort(#1.k > #2.k,q):% - - univariate(p: %,v: OV):SUP(%) == - zero?(p) => 0 - exp := degree p - locv := lookup v - deg:NonNegativeInteger := 0 - nexp := directProduct [if i=locv then (deg :=exp.i;0) else exp.i - for i in 1..n]$Vec - monomial(monomial(leadingCoefficient p,nexp),deg)+ - univariate(reductum p,v) - - eval(p: %,v: OV,val:%):% == univariate(p,v)(val) - - eval(p: %,v: OV,val:R):% == eval(p,v,val::%)$% - - eval(p: %,lv: List OV,lval: List R):% == - lv = [] => p - eval(eval(p,first lv,(first lval)::%)$%, rest lv, rest lval)$% - - -- assume Lvar are sorted correctly - evalSortedVarlist(p: %,Lvar: List OV,Lpval: List %):% == - v := mainVariable p - v case "failed" => p - pv := v:: OV - Lvar=[] or Lpval=[] => p - mvar := Lvar.first - mvar > pv => evalSortedVarlist(p,Lvar.rest,Lpval.rest) - pval := Lpval.first - pts:SUP(%):= map(evalSortedVarlist(#1,Lvar,Lpval),univariate(p,pv)) - mvar=pv => pts(pval) - multivariate(pts,pv) - - eval(p:%,Lvar:List OV,Lpval:List %) == - nlvar:List OV := sort(#1 > #2,Lvar) - nlpval := - Lvar = nlvar => Lpval - nlpval := [Lpval.position(mvar,Lvar) for mvar in nlvar] - evalSortedVarlist(p,nlvar,nlpval) - - multivariate(p1:SUP(%),v: OV):% == - 0=p1 => 0 - degree p1 = 0 => leadingCoefficient p1 - leadingCoefficient(p1)*(v::%)**degree(p1) + - multivariate(reductum p1,v) - - univariate(p: %):SUP(R) == - (v := mainVariable p) case "failed" => - monomial(leadingCoefficient p,0) - q := univariate(p,v:: OV) - ans:SUP(R) := 0 - while q ^= 0 repeat - ans := ans + monomial(ground leadingCoefficient q,degree q) - q := reductum q - ans - - multivariate(p:SUP(R),v: OV):% == - 0=p => 0 - (leadingCoefficient p)*monomial(1,v,degree p) + - multivariate(reductum p,v) - - if R has GcdDomain then - content(p: %):R == - zero?(p) => 0 - "gcd"/[t.c for t in p] - - - - if R has EuclideanDomain and not(R has FloatingPointSystem) then - gcd(p: %,q:%):% == - gcd(p,q)$PolynomialGcdPackage(E,OV,R,%) - - else gcd(p: %,q:%):% == - r : R - (pv := mainVariable(p)) case "failed" => - (r := leadingCoefficient p) = 0$R => q - gcd(r,content q)::% - (qv := mainVariable(q)) case "failed" => - (r := leadingCoefficient q) = 0$R => p - gcd(r,content p)::% - pv gcd(p,content univariate(q,qv)) - qv gcd(q,content univariate(p,pv)) - multivariate(gcd(univariate(p,pv),univariate(q,qv)),pv) - - coerce(p: %) : OutputForm == - zero?(p) => (0$R) :: OutputForm - l,lt : List OutputForm - lt := nil - vl1 := [v::OutputForm for v in vl] - for t in reverse p repeat - l := nil - for i in 1..#vl1 repeat - t.k.i = 0 => l - t.k.i = 1 => l := cons(vl1.i,l) - l := cons(vl1.i ** t.k.i ::OutputForm,l) - l := reverse l - if (t.c ^= 1) or (null l) then l := cons(t.c :: OutputForm,l) - 1 = #l => lt := cons(first l,lt) - lt := cons(reduce("*",l),lt) - 1 = #lt => first lt - reduce("+",lt) - -@ -\section{domain DMP DistributedMultivariatePolynomial} -<>= --- gdpoly.spad.pamphlet DistributedMultivariatePolynomial.input -)spool DistributedMultivariatePolynomial.output -)set message test on -)set message auto off -)clear all ---S 1 of 10 -(d1,d2,d3) : DMP([z,y,x],FRAC INT) ---R ---R Type: Void ---E 1 - ---S 2 of 10 -d1 := -4*z + 4*y**2*x + 16*x**2 + 1 ---R ---R ---R 2 2 ---R (2) - 4z + 4y x + 16x + 1 ---R Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 2 - ---S 3 of 10 -d2 := 2*z*y**2 + 4*x + 1 ---R ---R ---R 2 ---R (3) 2z y + 4x + 1 ---R Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 3 - ---S 4 of 10 -d3 := 2*z*x**2 - 2*y**2 - x ---R ---R ---R 2 2 ---R (4) 2z x - 2y - x ---R Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 4 - ---S 5 of 10 -groebner [d1,d2,d3] ---R ---R ---R (5) ---R 1568 6 1264 5 6 4 182 3 2047 2 103 2857 ---R [z - ---- x - ---- x + --- x + --- x - ---- x - ---- x - -----, ---R 2745 305 305 549 610 2745 10980 ---R 2 112 6 84 5 1264 4 13 3 84 2 1772 2 ---R y + ---- x - --- x - ---- x - --- x + --- x + ---- x + ----, ---R 2745 305 305 549 305 2745 2745 ---R 7 29 6 17 4 11 3 1 2 15 1 ---R x + -- x - -- x - -- x + -- x + -- x + -] ---R 4 16 8 32 16 4 ---R Type: List DistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 5 - ---S 6 of 10 -(n1,n2,n3) : HDMP([z,y,x],FRAC INT) ---R ---R Type: Void ---E 6 - ---S 7 of 10 -n1 := d1 ---R ---R ---R 2 2 ---R (7) 4y x + 16x - 4z + 1 ---R Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 7 - ---S 8 of 10 -n2 := d2 ---R ---R ---R 2 ---R (8) 2z y + 4x + 1 ---R Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 8 - ---S 9 of 10 -n3 := d3 ---R ---R ---R 2 2 ---R (9) 2z x - 2y - x ---R Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 9 - ---S 10 of 10 -groebner [n1,n2,n3] ---R ---R ---R (10) ---R 4 3 3 2 1 1 4 29 3 1 2 7 9 1 ---R [y + 2x - - x + - z - -, x + -- x - - y - - z x - -- x - -, ---R 2 2 8 4 8 4 16 4 ---R 2 1 2 2 1 2 2 1 ---R z y + 2x + -, y x + 4x - z + -, z x - y - - x, ---R 2 4 2 ---R 2 2 2 1 3 ---R z - 4y + 2x - - z - - x] ---R 4 2 ---RType: List HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 10 -)spool -)lisp (bye) -@ - -<>= -==================================================================== -MultivariatePolynomial -DistributedMultivariatePolynomial -HomogeneousDistributedMultivariatePolynomial -GeneralDistributedMultivariatePolynomial -==================================================================== - -DistributedMultivariatePolynomial which is abbreviated as DMP and -HomogeneousDistributedMultivariatePolynomial, which is abbreviated -as HDMP, are very similar to MultivariatePolynomial except that -they are represented and displayed in a non-recursive manner. - - (d1,d2,d3) : DMP([z,y,x],FRAC INT) - Type: Void - -The constructor DMP orders its monomials lexicographically while -HDMP orders them by total order refined by reverse lexicographic -order. - - d1 := -4*z + 4*y**2*x + 16*x**2 + 1 - 2 2 - - 4z + 4y x + 16x + 1 - Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) - - d2 := 2*z*y**2 + 4*x + 1 - 2 - 2z y + 4x + 1 - Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) - - d3 := 2*z*x**2 - 2*y**2 - x - 2 2 - 2z x - 2y - x - Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) - -These constructors are mostly used in Groebner basis calculations. - - groebner [d1,d2,d3] - 1568 6 1264 5 6 4 182 3 2047 2 103 2857 - [z - ---- x - ---- x + --- x + --- x - ---- x - ---- x - -----, - 2745 305 305 549 610 2745 10980 - 2 112 6 84 5 1264 4 13 3 84 2 1772 2 - y + ---- x - --- x - ---- x - --- x + --- x + ---- x + ----, - 2745 305 305 549 305 2745 2745 - 7 29 6 17 4 11 3 1 2 15 1 - x + -- x - -- x - -- x + -- x + -- x + -] - 4 16 8 32 16 4 - Type: List DistributedMultivariatePolynomial([z,y,x],Fraction Integer) - - (n1,n2,n3) : HDMP([z,y,x],FRAC INT) - Type: Void - - n1 := d1 - 2 2 - 4y x + 16x - 4z + 1 - Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) - - n2 := d2 - 2 - 2z y + 4x + 1 - Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) - - n3 := d3 - 2 2 - 2z x - 2y - x - Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) - -Note that we get a different Groebner basis when we use the HDMP -polynomials, as expected. - - groebner [n1,n2,n3] - 4 3 3 2 1 1 4 29 3 1 2 7 9 1 - [y + 2x - - x + - z - -, x + -- x - - y - - z x - -- x - -, - 2 2 8 4 8 4 16 4 - 2 1 2 2 1 2 2 1 - z y + 2x + -, y x + 4x - z + -, z x - y - - x, - 2 4 2 - 2 2 2 1 3 - z - 4y + 2x - - z - - x] - 4 2 - Type: List HomogeneousDistributedMultivariatePolynomial([z,y,x], - Fraction Integer) - -GeneralDistributedMultivariatePolynomial is somewhat more flexible in -the sense that as well as accepting a list of variables to specify the -variable ordering, it also takes a predicate on exponent vectors to -specify the term ordering. With this polynomial type the user can -experiment with the effect of using completely arbitrary term orderings. -This flexibility is mostly important for algorithms such as Groebner -basis calculations which can be very sensitive to term ordering. - -See Also: -o )help Polynomial -o )help UnivariatePolynomial -o )help MultivariatePolynomial -o )help HomogeneousDistributedMultivariatePolynomial -o )help GeneralDistributedMultivariatePolynomial -o )show DistributedMultivariatePolynomial -o $AXIOM/doc/src/algebra/gdpoly.spad.dvi - -@ -<>= -)abbrev domain DMP DistributedMultivariatePolynomial -++ Author: Barry Trager -++ Date Created: -++ Date Last Updated: -++ Basic Functions: Ring, degree, eval, coefficient, monomial, differentiate, -++ resultant, gcd, leadingCoefficient -++ Related Constructors: GeneralDistributedMultivariatePolynomial, -++ HomogeneousDistributedMultivariatePolynomial -++ Also See: Polynomial -++ AMS Classifications: -++ Keywords: polynomial, multivariate, distributed -++ References: -++ Description: -++ This type supports distributed multivariate polynomials -++ whose variables are from a user specified list of symbols. -++ The coefficient ring may be non commutative, -++ but the variables are assumed to commute. -++ The term ordering is lexicographic specified by the variable -++ list parameter with the most significant variable first in the list. -DistributedMultivariatePolynomial(vl,R): public == private where - vl : List Symbol - R : Ring - E ==> DirectProduct(#vl,NonNegativeInteger) - OV ==> OrderedVariableList(vl) - public == PolynomialCategory(R,E,OV) with - reorder: (%,List Integer) -> % - ++ reorder(p, perm) applies the permutation perm to the variables - ++ in a polynomial and returns the new correctly ordered polynomial - - private == - GeneralDistributedMultivariatePolynomial(vl,R,E) - -@ -\section{domain HDMP HomogeneousDistributedMultivariatePolynomial} -<>= --- gdpoly.spad.pamphlet HomogeneousDistributedMultivariatePolynomial.input -)spool HomogeneousDistributedMultivariatePolynomial.output -)set message test on -)set message auto off -)clear all ---S 1 of 10 -(d1,d2,d3) : DMP([z,y,x],FRAC INT) ---R ---R Type: Void ---E 1 - ---S 2 of 10 -d1 := -4*z + 4*y**2*x + 16*x**2 + 1 ---R ---R ---R 2 2 ---R (2) - 4z + 4y x + 16x + 1 ---R Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 2 - ---S 3 of 10 -d2 := 2*z*y**2 + 4*x + 1 ---R ---R ---R 2 ---R (3) 2z y + 4x + 1 ---R Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 3 - ---S 4 of 10 -d3 := 2*z*x**2 - 2*y**2 - x ---R ---R ---R 2 2 ---R (4) 2z x - 2y - x ---R Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 4 - ---S 5 of 10 -groebner [d1,d2,d3] ---R ---R ---R (5) ---R 1568 6 1264 5 6 4 182 3 2047 2 103 2857 ---R [z - ---- x - ---- x + --- x + --- x - ---- x - ---- x - -----, ---R 2745 305 305 549 610 2745 10980 ---R 2 112 6 84 5 1264 4 13 3 84 2 1772 2 ---R y + ---- x - --- x - ---- x - --- x + --- x + ---- x + ----, ---R 2745 305 305 549 305 2745 2745 ---R 7 29 6 17 4 11 3 1 2 15 1 ---R x + -- x - -- x - -- x + -- x + -- x + -] ---R 4 16 8 32 16 4 ---R Type: List DistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 5 - ---S 6 of 10 -(n1,n2,n3) : HDMP([z,y,x],FRAC INT) ---R ---R Type: Void ---E 6 - ---S 7 of 10 -n1 := d1 ---R ---R ---R 2 2 ---R (7) 4y x + 16x - 4z + 1 ---R Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 7 - ---S 8 of 10 -n2 := d2 ---R ---R ---R 2 ---R (8) 2z y + 4x + 1 ---R Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 8 - ---S 9 of 10 -n3 := d3 ---R ---R ---R 2 2 ---R (9) 2z x - 2y - x ---R Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 9 - ---S 10 of 10 -groebner [n1,n2,n3] ---R ---R ---R (10) ---R 4 3 3 2 1 1 4 29 3 1 2 7 9 1 ---R [y + 2x - - x + - z - -, x + -- x - - y - - z x - -- x - -, ---R 2 2 8 4 8 4 16 4 ---R 2 1 2 2 1 2 2 1 ---R z y + 2x + -, y x + 4x - z + -, z x - y - - x, ---R 2 4 2 ---R 2 2 2 1 3 ---R z - 4y + 2x - - z - - x] ---R 4 2 ---RType: List HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) ---E 10 -)spool -)lisp (bye) -@ - -<>= -==================================================================== -MultivariatePolynomial -DistributedMultivariatePolynomial -HomogeneousDistributedMultivariatePolynomial -GeneralDistributedMultivariatePolynomial -==================================================================== - -DistributedMultivariatePolynomial which is abbreviated as DMP and -HomogeneousDistributedMultivariatePolynomial, which is abbreviated -as HDMP, are very similar to MultivariatePolynomial except that -they are represented and displayed in a non-recursive manner. - - (d1,d2,d3) : DMP([z,y,x],FRAC INT) - Type: Void - -The constructor DMP orders its monomials lexicographically while -HDMP orders them by total order refined by reverse lexicographic -order. - - d1 := -4*z + 4*y**2*x + 16*x**2 + 1 - 2 2 - - 4z + 4y x + 16x + 1 - Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) - - d2 := 2*z*y**2 + 4*x + 1 - 2 - 2z y + 4x + 1 - Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) - - d3 := 2*z*x**2 - 2*y**2 - x - 2 2 - 2z x - 2y - x - Type: DistributedMultivariatePolynomial([z,y,x],Fraction Integer) - -These constructors are mostly used in Groebner basis calculations. - - groebner [d1,d2,d3] - 1568 6 1264 5 6 4 182 3 2047 2 103 2857 - [z - ---- x - ---- x + --- x + --- x - ---- x - ---- x - -----, - 2745 305 305 549 610 2745 10980 - 2 112 6 84 5 1264 4 13 3 84 2 1772 2 - y + ---- x - --- x - ---- x - --- x + --- x + ---- x + ----, - 2745 305 305 549 305 2745 2745 - 7 29 6 17 4 11 3 1 2 15 1 - x + -- x - -- x - -- x + -- x + -- x + -] - 4 16 8 32 16 4 - Type: List DistributedMultivariatePolynomial([z,y,x],Fraction Integer) - - (n1,n2,n3) : HDMP([z,y,x],FRAC INT) - Type: Void - - n1 := d1 - 2 2 - 4y x + 16x - 4z + 1 - Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) - - n2 := d2 - 2 - 2z y + 4x + 1 - Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) - - n3 := d3 - 2 2 - 2z x - 2y - x - Type: HomogeneousDistributedMultivariatePolynomial([z,y,x],Fraction Integer) - -Note that we get a different Groebner basis when we use the HDMP -polynomials, as expected. - - groebner [n1,n2,n3] - 4 3 3 2 1 1 4 29 3 1 2 7 9 1 - [y + 2x - - x + - z - -, x + -- x - - y - - z x - -- x - -, - 2 2 8 4 8 4 16 4 - 2 1 2 2 1 2 2 1 - z y + 2x + -, y x + 4x - z + -, z x - y - - x, - 2 4 2 - 2 2 2 1 3 - z - 4y + 2x - - z - - x] - 4 2 - Type: List HomogeneousDistributedMultivariatePolynomial([z,y,x], - Fraction Integer) - -GeneralDistributedMultivariatePolynomial is somewhat more flexible in -the sense that as well as accepting a list of variables to specify the -variable ordering, it also takes a predicate on exponent vectors to -specify the term ordering. With this polynomial type the user can -experiment with the effect of using completely arbitrary term orderings. -This flexibility is mostly important for algorithms such as Groebner -basis calculations which can be very sensitive to term ordering. - -See Also: -o )help Polynomial -o )help UnivariatePolynomial -o )help MultivariatePolynomial -o )help DistributedMultivariatePolynomial -o )help GeneralDistributedMultivariatePolynomial -o )show HomogeneousDistributedMultivariatePolynomial -o $AXIOM/doc/src/algebra/gdpoly.spad.dvi - -@ -<>= -)abbrev domain HDMP HomogeneousDistributedMultivariatePolynomial -++ Author: Barry Trager -++ Date Created: -++ Date Last Updated: -++ Basic Functions: Ring, degree, eval, coefficient, monomial, differentiate, -++ resultant, gcd, leadingCoefficient -++ Related Constructors: DistributedMultivariatePolynomial, -++ GeneralDistributedMultivariatePolynomial -++ Also See: Polynomial -++ AMS Classifications: -++ Keywords: polynomial, multivariate, distributed -++ References: -++ Description: -++ This type supports distributed multivariate polynomials -++ whose variables are from a user specified list of symbols. -++ The coefficient ring may be non commutative, -++ but the variables are assumed to commute. -++ The term ordering is total degree ordering refined by reverse -++ lexicographic ordering with respect to the position that the variables -++ appear in the list of variables parameter. -HomogeneousDistributedMultivariatePolynomial(vl,R): public == private where - vl : List Symbol - R : Ring - E ==> HomogeneousDirectProduct(#vl,NonNegativeInteger) - OV ==> OrderedVariableList(vl) - public == PolynomialCategory(R,E,OV) with - reorder: (%,List Integer) -> % - ++ reorder(p, perm) applies the permutation perm to the variables - ++ in a polynomial and returns the new correctly ordered polynomial - private == - GeneralDistributedMultivariatePolynomial(vl,R,E) - -@ -\section{License} -<>= ---Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. ---All rights reserved. --- ---Redistribution and use in source and binary forms, with or without ---modification, are permitted provided that the following conditions are ---met: --- --- - Redistributions of source code must retain the above copyright --- notice, this list of conditions and the following disclaimer. --- --- - Redistributions in binary form must reproduce the above copyright --- notice, this list of conditions and the following disclaimer in --- the documentation and/or other materials provided with the --- distribution. --- --- - Neither the name of The Numerical ALgorithms Group Ltd. nor the --- names of its contributors may be used to endorse or promote products --- derived from this software without specific prior written permission. --- ---THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS ---IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ---TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A ---PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER ---OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ---EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ---PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ---PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ---LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ---NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ---SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -@ -<<*>>= -<> - -<> -<> -<> -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document} - diff --git a/src/algebra/generic.spad.pamphlet b/src/algebra/generic.spad.pamphlet index 611284b..1d017d3 100644 --- a/src/algebra/generic.spad.pamphlet +++ b/src/algebra/generic.spad.pamphlet @@ -9,302 +9,6 @@ \eject \tableofcontents \eject -\section{domain GCNAALG GenericNonAssociativeAlgebra} -<>= -)abbrev domain GCNAALG GenericNonAssociativeAlgebra -++ Authors: J. Grabmeier, R. Wisbauer -++ Date Created: 26 June 1991 -++ Date Last Updated: 26 June 1991 -++ Basic Operations: generic -++ Related Constructors: AlgebraPackage -++ Also See: -++ AMS Classifications: -++ Keywords: generic element. rank polynomial -++ Reference: -++ A. Woerz-Busekros: Algebra in Genetics -++ Lectures Notes in Biomathematics 36, -++ Springer-Verlag, Heidelberg, 1980 -++ Description: -++ AlgebraGenericElementPackage allows you to create generic elements -++ of an algebra, i.e. the scalars are extended to include symbolic -++ coefficients -GenericNonAssociativeAlgebra(R : CommutativeRing, n : PositiveInteger,_ - ls : List Symbol, gamma: Vector Matrix R ): public == private where - - NNI ==> NonNegativeInteger - V ==> Vector - PR ==> Polynomial R - FPR ==> Fraction Polynomial R - SUP ==> SparseUnivariatePolynomial - S ==> Symbol - - public ==> Join(FramedNonAssociativeAlgebra(FPR), _ - LeftModule(SquareMatrix(n,FPR)) ) with - - coerce : Vector FPR -> % - ++ coerce(v) assumes that it is called with a vector - ++ of length equal to the dimension of the algebra, then - ++ a linear combination with the basis element is formed - leftUnits:() -> Union(Record(particular: %, basis: List %), "failed") - ++ leftUnits() returns the affine space of all left units of the - ++ algebra, or \spad{"failed"} if there is none - rightUnits:() -> Union(Record(particular: %, basis: List %), "failed") - ++ rightUnits() returns the affine space of all right units of the - ++ algebra, or \spad{"failed"} if there is none - generic : () -> % - ++ generic() returns a generic element, i.e. the linear combination - ++ of the fixed basis with the symbolic coefficients - ++ \spad{%x1,%x2,..} - generic : Symbol -> % - ++ generic(s) returns a generic element, i.e. the linear combination - ++ of the fixed basis with the symbolic coefficients - ++ \spad{s1,s2,..} - generic : Vector Symbol -> % - ++ generic(vs) returns a generic element, i.e. the linear combination - ++ of the fixed basis with the symbolic coefficients - ++ \spad{vs}; - ++ error, if the vector of symbols is too short - generic : Vector % -> % - ++ generic(ve) returns a generic element, i.e. the linear combination - ++ of \spad{ve} basis with the symbolic coefficients - ++ \spad{%x1,%x2,..} - generic : (Symbol, Vector %) -> % - ++ generic(s,v) returns a generic element, i.e. the linear combination - ++ of v with the symbolic coefficients - ++ \spad{s1,s2,..} - generic : (Vector Symbol, Vector %) -> % - ++ generic(vs,ve) returns a generic element, i.e. the linear combination - ++ of \spad{ve} with the symbolic coefficients \spad{vs} - ++ error, if the vector of symbols is shorter than the vector of - ++ elements - if R has IntegralDomain then - leftRankPolynomial : () -> SparseUnivariatePolynomial FPR - ++ leftRankPolynomial() returns the left minimimal polynomial - ++ of the generic element - genericLeftMinimalPolynomial : % -> SparseUnivariatePolynomial FPR - ++ genericLeftMinimalPolynomial(a) substitutes the coefficients - ++ of {em a} for the generic coefficients in - ++ \spad{leftRankPolynomial()} - genericLeftTrace : % -> FPR - ++ genericLeftTrace(a) substitutes the coefficients - ++ of \spad{a} for the generic coefficients into the - ++ coefficient of the second highest term in - ++ \spadfun{leftRankPolynomial} and changes the sign. - ++ This is a linear form - genericLeftNorm : % -> FPR - ++ genericLeftNorm(a) substitutes the coefficients - ++ of \spad{a} for the generic coefficients into the - ++ coefficient of the constant term in \spadfun{leftRankPolynomial} - ++ and changes the sign if the degree of this polynomial is odd. - ++ This is a form of degree k - rightRankPolynomial : () -> SparseUnivariatePolynomial FPR - ++ rightRankPolynomial() returns the right minimimal polynomial - ++ of the generic element - genericRightMinimalPolynomial : % -> SparseUnivariatePolynomial FPR - ++ genericRightMinimalPolynomial(a) substitutes the coefficients - ++ of \spad{a} for the generic coefficients in - ++ \spadfun{rightRankPolynomial} - genericRightTrace : % -> FPR - ++ genericRightTrace(a) substitutes the coefficients - ++ of \spad{a} for the generic coefficients into the - ++ coefficient of the second highest term in - ++ \spadfun{rightRankPolynomial} and changes the sign - genericRightNorm : % -> FPR - ++ genericRightNorm(a) substitutes the coefficients - ++ of \spad{a} for the generic coefficients into the - ++ coefficient of the constant term in \spadfun{rightRankPolynomial} - ++ and changes the sign if the degree of this polynomial is odd - genericLeftTraceForm : (%,%) -> FPR - ++ genericLeftTraceForm (a,b) is defined to be - ++ \spad{genericLeftTrace (a*b)}, this defines - ++ a symmetric bilinear form on the algebra - genericLeftDiscriminant: () -> FPR - ++ genericLeftDiscriminant() is the determinant of the - ++ generic left trace forms of all products of basis element, - ++ if the generic left trace form is associative, an algebra - ++ is separable if the generic left discriminant is invertible, - ++ if it is non-zero, there is some ring extension which - ++ makes the algebra separable - genericRightTraceForm : (%,%) -> FPR - ++ genericRightTraceForm (a,b) is defined to be - ++ \spadfun{genericRightTrace (a*b)}, this defines - ++ a symmetric bilinear form on the algebra - genericRightDiscriminant: () -> FPR - ++ genericRightDiscriminant() is the determinant of the - ++ generic left trace forms of all products of basis element, - ++ if the generic left trace form is associative, an algebra - ++ is separable if the generic left discriminant is invertible, - ++ if it is non-zero, there is some ring extension which - ++ makes the algebra separable - conditionsForIdempotents: Vector % -> List Polynomial R - ++ conditionsForIdempotents([v1,...,vn]) determines a complete list - ++ of polynomial equations for the coefficients of idempotents - ++ with respect to the \spad{R}-module basis \spad{v1},...,\spad{vn} - conditionsForIdempotents: () -> List Polynomial R - ++ conditionsForIdempotents() determines a complete list - ++ of polynomial equations for the coefficients of idempotents - ++ with respect to the fixed \spad{R}-module basis - - private ==> AlgebraGivenByStructuralConstants(FPR,n,ls,_ - coerce(gamma)$CoerceVectorMatrixPackage(R) ) add - - listOfNumbers : List String := [STRINGIMAGE(q)$Lisp for q in 1..n] - symbolsForCoef : V Symbol := - [concat("%", concat("x", i))::Symbol for i in listOfNumbers] - genericElement : % := - v : Vector PR := - [monomial(1$PR, [symbolsForCoef.i],[1]) for i in 1..n] - convert map(coerce,v)$VectorFunctions2(PR,FPR) - - eval : (FPR, %) -> FPR - eval(rf,a) == - -- for the moment we only substitute the numerators - -- of the coefficients - coefOfa : List PR := - map(numer, entries coordinates a)$ListFunctions2(FPR,PR) - ls : List PR :=[monomial(1$PR, [s],[1]) for s in entries symbolsForCoef] - lEq : List Equation PR := [] - for i in 1..maxIndex ls repeat - lEq := cons(equation(ls.i,coefOfa.i)$Equation(PR) , lEq) - top : PR := eval(numer(rf),lEq)$PR - bot : PR := eval(numer(rf),lEq)$PR - top/bot - - - if R has IntegralDomain then - - genericLeftTraceForm(a,b) == genericLeftTrace(a*b) - genericLeftDiscriminant() == - listBasis : List % := entries basis()$% - m : Matrix FPR := matrix - [[genericLeftTraceForm(a,b) for a in listBasis] for b in listBasis] - determinant m - - genericRightTraceForm(a,b) == genericRightTrace(a*b) - genericRightDiscriminant() == - listBasis : List % := entries basis()$% - m : Matrix FPR := matrix - [[genericRightTraceForm(a,b) for a in listBasis] for b in listBasis] - determinant m - - - - leftRankPoly : SparseUnivariatePolynomial FPR := 0 - initLeft? : Boolean :=true - - initializeLeft: () -> Void - initializeLeft() == - -- reset initialize flag - initLeft?:=false - leftRankPoly := leftMinimalPolynomial genericElement - void()$Void - - rightRankPoly : SparseUnivariatePolynomial FPR := 0 - initRight? : Boolean :=true - - initializeRight: () -> Void - initializeRight() == - -- reset initialize flag - initRight?:=false - rightRankPoly := rightMinimalPolynomial genericElement - void()$Void - - leftRankPolynomial() == - if initLeft? then initializeLeft() - leftRankPoly - - rightRankPolynomial() == - if initRight? then initializeRight() - rightRankPoly - - genericLeftMinimalPolynomial a == - if initLeft? then initializeLeft() - map(eval(#1,a),leftRankPoly)$SUP(FPR) - - genericRightMinimalPolynomial a == - if initRight? then initializeRight() - map(eval(#1,a),rightRankPoly)$SUP(FPR) - - genericLeftTrace a == - if initLeft? then initializeLeft() - d1 : NNI := (degree leftRankPoly - 1) :: NNI - rf : FPR := coefficient(leftRankPoly, d1) - rf := eval(rf,a) - - rf - - genericRightTrace a == - if initRight? then initializeRight() - d1 : NNI := (degree rightRankPoly - 1) :: NNI - rf : FPR := coefficient(rightRankPoly, d1) - rf := eval(rf,a) - - rf - - genericLeftNorm a == - if initLeft? then initializeLeft() - rf : FPR := coefficient(leftRankPoly, 1) - if odd? degree leftRankPoly then rf := - rf - rf - - genericRightNorm a == - if initRight? then initializeRight() - rf : FPR := coefficient(rightRankPoly, 1) - if odd? degree rightRankPoly then rf := - rf - rf - - conditionsForIdempotents(b: V %) : List Polynomial R == - x : % := generic(b) - map(numer,entries coordinates(x*x-x,b))$ListFunctions2(FPR,PR) - - conditionsForIdempotents(): List Polynomial R == - x : % := genericElement - map(numer,entries coordinates(x*x-x))$ListFunctions2(FPR,PR) - - generic() == genericElement - - generic(vs:V S, ve: V %): % == - maxIndex v > maxIndex ve => - error "generic: too little symbols" - v : Vector PR := - [monomial(1$PR, [vs.i],[1]) for i in 1..maxIndex ve] - represents(map(coerce,v)$VectorFunctions2(PR,FPR),ve) - - generic(s: S, ve: V %): % == - lON : List String := [STRINGIMAGE(q)$Lisp for q in 1..maxIndex ve] - sFC : Vector Symbol := - [concat(s pretend String, i)::Symbol for i in lON] - generic(sFC, ve) - - generic(ve : V %) == - lON : List String := [STRINGIMAGE(q)$Lisp for q in 1..maxIndex ve] - sFC : Vector Symbol := - [concat("%", concat("x", i))::Symbol for i in lON] - v : Vector PR := - [monomial(1$PR, [sFC.i],[1]) for i in 1..maxIndex ve] - represents(map(coerce,v)$VectorFunctions2(PR,FPR),ve) - - generic(vs:V S): % == generic(vs, basis()$%) - - generic(s: S): % == generic(s, basis()$%) - -)fin - -- variations on eval - --coefOfa : List FPR := entries coordinates a - --ls : List Symbol := entries symbolsForCoef - -- a very dangerous sequential implementation for the moment, - -- because the compiler doesn't manage the parallel code - -- also doesn't run: - -- not known that (Fraction (Polynomial R)) has (has (Polynomial R) - -- (Evalable (Fraction (Polynomial R)))) - --res : FPR := rf - --for eq in lEq repeat res := eval(res,eq)$FPR - --res - --rf - --eval(rf, le)$FPR - --eval(rf, entries symbolsForCoef, coefOfa)$FPR - --eval(rf, ls, coefOfa)$FPR - --le : List Equation PR := [equation(lh,rh) for lh in ls for rh in coefOfa] - -@ \section{package CVMP CoerceVectorMatrixPackage} <>= )abbrev package CVMP CoerceVectorMatrixPackage @@ -396,7 +100,6 @@ CoerceVectorMatrixPackage(R : CommutativeRing): public == private where <<*>>= <> -<> <> @ \eject diff --git a/src/algebra/gpol.spad.pamphlet b/src/algebra/gpol.spad.pamphlet deleted file mode 100644 index a4563b0..0000000 --- a/src/algebra/gpol.spad.pamphlet +++ /dev/null @@ -1,214 +0,0 @@ -\documentclass{article} -\usepackage{axiom} -\begin{document} -\title{\$SPAD/src/algebra gpol.spad} -\author{Manuel Bronstein} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject -\section{domain LAUPOL LaurentPolynomial} -<>= -)abbrev domain LAUPOL LaurentPolynomial -++ Univariate polynomials with negative and positive exponents. -++ Author: Manuel Bronstein -++ Date Created: May 1988 -++ Date Last Updated: 26 Apr 1990 -LaurentPolynomial(R, UP): Exports == Implementation where - R : IntegralDomain - UP: UnivariatePolynomialCategory R - - O ==> OutputForm - B ==> Boolean - N ==> NonNegativeInteger - Z ==> Integer - RF ==> Fraction UP - - Exports ==> Join(DifferentialExtension UP, IntegralDomain, - ConvertibleTo RF, FullyRetractableTo R, RetractableTo UP) with - monomial? : % -> B - ++ monomial?(x) \undocumented - degree : % -> Z - ++ degree(x) \undocumented - order : % -> Z - ++ order(x) \undocumented - reductum : % -> % - ++ reductum(x) \undocumented - leadingCoefficient : % -> R - ++ leadingCoefficient \undocumented - trailingCoefficient: % -> R - ++ trailingCoefficient \undocumented - coefficient : (%, Z) -> R - ++ coefficient(x,n) \undocumented - monomial : (R, Z) -> % - ++ monomial(x,n) \undocumented - if R has CharacteristicZero then CharacteristicZero - if R has CharacteristicNonZero then CharacteristicNonZero - if R has Field then - EuclideanDomain - separate: RF -> Record(polyPart:%, fracPart:RF) - ++ separate(x) \undocumented - - Implementation ==> add - Rep := Record(polypart: UP, order0: Z) - - poly : % -> UP - check0 : (Z, UP) -> % - mkgpol : (Z, UP) -> % - gpol : (UP, Z) -> % - toutput: (R, Z, O) -> O - monTerm: (R, Z, O) -> O - - 0 == [0, 0] - 1 == [1, 0] - p = q == p.order0 = q.order0 and p.polypart = q.polypart - poly p == p.polypart - order p == p.order0 - gpol(p, n) == [p, n] - monomial(r, n) == check0(n, r::UP) - coerce(p:UP):% == mkgpol(0, p) - reductum p == check0(order p, reductum poly p) - n:Z * p:% == check0(order p, n * poly p) - characteristic() == characteristic()$R - coerce(n:Z):% == n::R::% - degree p == degree(poly p)::Z + order p - monomial? p == monomial? poly p - coerce(r:R):% == gpol(r::UP, 0) - convert(p:%):RF == poly(p) * (monomial(1, 1)$UP)::RF ** order p - p:% * q:% == check0(order p + order q, poly p * poly q) - - p == gpol(- poly p, order p) - check0(n, p) == (zero? p => 0; gpol(p, n)) - trailingCoefficient p == coefficient(poly p, 0) - leadingCoefficient p == leadingCoefficient poly p - - coerce(p:%):O == - zero? p => 0::Z::O - l := nil()$List(O) - v := monomial(1, 1)$UP :: O - while p ^= 0 repeat - l := concat(l, toutput(leadingCoefficient p, degree p, v)) - p := reductum p - reduce("+", l) - - coefficient(p, n) == - (m := n - order p) < 0 => 0 - coefficient(poly p, m::N) - - differentiate(p:%, derivation:UP -> UP) == - t := monomial(1, 1)$UP - mkgpol(order(p) - 1, - derivation(poly p) * t + order(p) * poly(p) * derivation t) - - monTerm(r, n, v) == - zero? n => r::O --- one? n => v - (n = 1) => v - v ** (n::O) - - toutput(r, n, v) == - mon := monTerm(r, n, v) --- zero? n or one? r => mon - zero? n or (r = 1) => mon - r = -1 => - mon - r::O * mon - - recip p == - (q := recip poly p) case "failed" => "failed" - gpol(q::UP, - order p) - - p + q == - zero? q => p - zero? p => q - (d := order p - order q) > 0 => - gpol(poly(p) * monomial(1, d::N) + poly q, order q) - d < 0 => gpol(poly(p) + poly(q) * monomial(1, (-d)::N), order p) - mkgpol(order p, poly(p) + poly q) - - mkgpol(n, p) == - zero? p => 0 - d := order(p, monomial(1, 1)$UP) - gpol((p exquo monomial(1, d))::UP, n + d::Z) - - p exquo q == - (r := poly(p) exquo poly q) case "failed" => "failed" - check0(order p - order q, r::UP) - - retractIfCan(p:%):Union(UP, "failed") == - order(p) < 0 => error "Not retractable" - poly(p) * monomial(1, order(p)::N)$UP - - retractIfCan(p:%):Union(R, "failed") == - order(p) ^= 0 => "failed" - retractIfCan poly p - - if R has Field then - gcd(p, q) == gcd(poly p, poly q)::% - - separate f == - n := order(q := denom f, monomial(1, 1)) - q := (q exquo (tn := monomial(1, n)$UP))::UP - bc := extendedEuclidean(tn,q,numer f)::Record(coef1:UP,coef2:UP) - qr := divide(bc.coef1, q) - [mkgpol(-n, bc.coef2 + tn * qr.quotient), qr.remainder / q] - --- returns (z, r) s.t. p = q z + r, --- and degree(r) < degree(q), order(r) >= min(order(p), order(q)) - divide(p, q) == - c := min(order p, order q) - qr := divide(poly(p) * monomial(1, (order p - c)::N)$UP, poly q) - [mkgpol(c - order q, qr.quotient), mkgpol(c, qr.remainder)] - - euclideanSize p == degree poly p - - extendedEuclidean(a, b, c) == - (bc := extendedEuclidean(poly a, poly b, poly c)) case "failed" - => "failed" - [mkgpol(order c - order a, bc.coef1), - mkgpol(order c - order b, bc.coef2)] - -@ -\section{License} -<>= ---Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. ---All rights reserved. --- ---Redistribution and use in source and binary forms, with or without ---modification, are permitted provided that the following conditions are ---met: --- --- - Redistributions of source code must retain the above copyright --- notice, this list of conditions and the following disclaimer. --- --- - Redistributions in binary form must reproduce the above copyright --- notice, this list of conditions and the following disclaimer in --- the documentation and/or other materials provided with the --- distribution. --- --- - Neither the name of The Numerical ALgorithms Group Ltd. nor the --- names of its contributors may be used to endorse or promote products --- derived from this software without specific prior written permission. --- ---THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS ---IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ---TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A ---PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER ---OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ---EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ---PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ---PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ---LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ---NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ---SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -@ -<<*>>= -<> - -<> -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document} diff --git a/src/algebra/gseries.spad.pamphlet b/src/algebra/gseries.spad.pamphlet deleted file mode 100644 index cc152a3..0000000 --- a/src/algebra/gseries.spad.pamphlet +++ /dev/null @@ -1,165 +0,0 @@ -\documentclass{article} -\usepackage{axiom} -\begin{document} -\title{\$SPAD/src/algebra gseries.spad} -\author{Clifton J. Williamson} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject -\section{domain GSERIES GeneralUnivariatePowerSeries} -<>= -)abbrev domain GSERIES GeneralUnivariatePowerSeries -++ Author: Clifton J. Williamson -++ Date Created: 22 September 1993 -++ Date Last Updated: 23 September 1993 -++ Basic Operations: -++ Related Domains: -++ Also See: -++ AMS Classifications: -++ Keywords: series, Puiseux -++ Examples: -++ References: -++ Description: -++ This is a category of univariate Puiseux series constructed -++ from univariate Laurent series. A Puiseux series is represented -++ by a pair \spad{[r,f(x)]}, where r is a positive rational number and -++ \spad{f(x)} is a Laurent series. This pair represents the Puiseux -++ series \spad{f(x\^r)}. -GeneralUnivariatePowerSeries(Coef,var,cen): Exports == Implementation where - Coef : Ring - var : Symbol - cen : Coef - I ==> Integer - UTS ==> UnivariateTaylorSeries - ULS ==> UnivariateLaurentSeries - UPXS ==> UnivariatePuiseuxSeries - EFULS ==> ElementaryFunctionsUnivariateLaurentSeries - EFUPXS ==> ElementaryFunctionsUnivariatePuiseuxSeries - FS2UPS ==> FunctionSpaceToUnivariatePowerSeries - - Exports ==> UnivariatePuiseuxSeriesCategory Coef with - coerce: Variable(var) -> % - ++ coerce(var) converts the series variable \spad{var} into a - ++ Puiseux series. - coerce: UPXS(Coef,var,cen) -> % - ++ coerce(f) converts a Puiseux series to a general power series. - differentiate: (%,Variable(var)) -> % - ++ \spad{differentiate(f(x),x)} returns the derivative of - ++ \spad{f(x)} with respect to \spad{x}. - if Coef has Algebra Fraction Integer then - integrate: (%,Variable(var)) -> % - ++ \spad{integrate(f(x))} returns an anti-derivative of the power - ++ series \spad{f(x)} with constant coefficient 0. - ++ We may integrate a series when we can divide coefficients - ++ by integers. - - Implementation ==> UnivariatePuiseuxSeries(Coef,var,cen) add - - coerce(upxs:UPXS(Coef,var,cen)) == upxs pretend % - - puiseux: % -> UPXS(Coef,var,cen) - puiseux f == f pretend UPXS(Coef,var,cen) - - if Coef has Algebra Fraction Integer then - - differentiate f == - str1 : String := "'differentiate' unavailable on this domain; " - str2 : String := "use 'approximate' first" - error concat(str1,str2) - - differentiate(f:%,v:Variable(var)) == differentiate f - - if Coef has PartialDifferentialRing(Symbol) then - differentiate(f:%,s:Symbol) == - (s = variable(f)) => - str1 : String := "'differentiate' unavailable on this domain; " - str2 : String := "use 'approximate' first" - error concat(str1,str2) - dcds := differentiate(center f,s) - deriv := differentiate(puiseux f) :: % - map(differentiate(#1,s),f) - dcds * deriv - - integrate f == - str1 : String := "'integrate' unavailable on this domain; " - str2 : String := "use 'approximate' first" - error concat(str1,str2) - - integrate(f:%,v:Variable(var)) == integrate f - - if Coef has integrate: (Coef,Symbol) -> Coef and _ - Coef has variables: Coef -> List Symbol then - - integrate(f:%,s:Symbol) == - (s = variable(f)) => - str1 : String := "'integrate' unavailable on this domain; " - str2 : String := "use 'approximate' first" - error concat(str1,str2) - not entry?(s,variables center f) => map(integrate(#1,s),f) - error "integrate: center is a function of variable of integration" - - if Coef has TranscendentalFunctionCategory and _ - Coef has PrimitiveFunctionCategory and _ - Coef has AlgebraicallyClosedFunctionSpace Integer then - - integrateWithOneAnswer: (Coef,Symbol) -> Coef - integrateWithOneAnswer(f,s) == - res := integrate(f,s)$FunctionSpaceIntegration(Integer,Coef) - res case Coef => res :: Coef - first(res :: List Coef) - - integrate(f:%,s:Symbol) == - (s = variable(f)) => - str1 : String := "'integrate' unavailable on this domain; " - str2 : String := "use 'approximate' first" - error concat(str1,str2) - not entry?(s,variables center f) => - map(integrateWithOneAnswer(#1,s),f) - error "integrate: center is a function of variable of integration" - -@ -\section{License} -<>= ---Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. ---All rights reserved. --- ---Redistribution and use in source and binary forms, with or without ---modification, are permitted provided that the following conditions are ---met: --- --- - Redistributions of source code must retain the above copyright --- notice, this list of conditions and the following disclaimer. --- --- - Redistributions in binary form must reproduce the above copyright --- notice, this list of conditions and the following disclaimer in --- the documentation and/or other materials provided with the --- distribution. --- --- - Neither the name of The Numerical ALgorithms Group Ltd. nor the --- names of its contributors may be used to endorse or promote products --- derived from this software without specific prior written permission. --- ---THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS ---IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ---TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A ---PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER ---OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ---EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ---PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ---PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ---LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ---NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ---SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -@ -<<*>>= -<> - -<> -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document} diff --git a/src/algebra/ideal.spad.pamphlet b/src/algebra/ideal.spad.pamphlet deleted file mode 100644 index f1ba1d6..0000000 --- a/src/algebra/ideal.spad.pamphlet +++ /dev/null @@ -1,474 +0,0 @@ -\documentclass{article} -\usepackage{axiom} -\begin{document} -\title{\$SPAD/src/algebra ideal.spad} -\author{Patrizia Gianni} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject -\section{domain IDEAL PolynomialIdeals} -<>= -)abbrev domain IDEAL PolynomialIdeals -++ Author: P. Gianni -++ Date Created: summer 1986 -++ Date Last Updated: September 1996 -++ Basic Functions: -++ Related Constructors: -++ Also See: -++ AMS Classifications: -++ Keywords: -++ References: GTZ -++ Description: This domain represents polynomial ideals with coefficients in any -++ field and supports the basic ideal operations, including intersection -++ sum and quotient. -++ An ideal is represented by a list of polynomials (the generators of -++ the ideal) and a boolean that is true if the generators are a Groebner -++ basis. -++ The algorithms used are based on Groebner basis computations. The -++ ordering is determined by the datatype of the input polynomials. -++ Users may use refinements of total degree orderings. - -PolynomialIdeals(F,Expon,VarSet,DPoly) : C == T - where - F : Field - Expon : OrderedAbelianMonoidSup - VarSet : OrderedSet - DPoly : PolynomialCategory(F,Expon,VarSet) - - SUP ==> SparseUnivariatePolynomial(DPoly) - NNI ==> NonNegativeInteger - Z ==> Integer - P ==> Polynomial F - MF ==> Matrix(F) - ST ==> SuchThat(List P, List Equation P) - - GenMPos ==> Record(mval:MF,invmval:MF,genIdeal:Ideal) - Ideal ==> % - - C == SetCategory with - - "*" : (Ideal,Ideal) -> Ideal - ++ I*J computes the product of the ideal I and J. - "**" : (Ideal,NNI) -> Ideal - ++ I**n computes the nth power of the ideal I. - "+" : (Ideal,Ideal) -> Ideal - ++ I+J computes the ideal generated by the union of I and J. - one? : Ideal -> Boolean - ++ one?(I) tests whether the ideal I is the unit ideal, - ++ i.e. contains 1. - zero? : Ideal -> Boolean - ++ zero?(I) tests whether the ideal I is the zero ideal - element? : (DPoly,Ideal) -> Boolean - ++ element?(f,I) tests whether the polynomial f belongs to - ++ the ideal I. - in? : (Ideal,Ideal) -> Boolean - ++ in?(I,J) tests if the ideal I is contained in the ideal J. - inRadical? : (DPoly,Ideal) -> Boolean - ++ inRadical?(f,I) tests if some power of the polynomial f - ++ belongs to the ideal I. - zeroDim? : (Ideal,List VarSet) -> Boolean - ++ zeroDim?(I,lvar) tests if the ideal I is zero dimensional, i.e. - ++ all its associated primes are maximal, - ++ in the ring \spad{F[lvar]} - zeroDim? : Ideal -> Boolean - ++ zeroDim?(I) tests if the ideal I is zero dimensional, i.e. - ++ all its associated primes are maximal, - ++ in the ring \spad{F[lvar]}, where lvar are the variables appearing in I - intersect : (Ideal,Ideal) -> Ideal - ++ intersect(I,J) computes the intersection of the ideals I and J. - intersect : List(Ideal) -> Ideal - ++ intersect(LI) computes the intersection of the list of ideals LI. - quotient : (Ideal,Ideal) -> Ideal - ++ quotient(I,J) computes the quotient of the ideals I and J, \spad{(I:J)}. - quotient : (Ideal,DPoly) -> Ideal - ++ quotient(I,f) computes the quotient of the ideal I by the principal - ++ ideal generated by the polynomial f, \spad{(I:(f))}. - groebner : Ideal -> Ideal - ++ groebner(I) returns a set of generators of I that are a Groebner basis - ++ for I. - generalPosition : (Ideal,List VarSet) -> GenMPos - ++ generalPosition(I,listvar) perform a random linear - ++ transformation on the variables in listvar and returns - ++ the transformed ideal along with the change of basis matrix. - backOldPos : GenMPos -> Ideal - ++ backOldPos(genPos) takes the result - ++ produced by \spadfunFrom{generalPosition}{PolynomialIdeals} - ++ and performs the inverse transformation, returning the original ideal - ++ \spad{backOldPos(generalPosition(I,listvar))} = I. - dimension : (Ideal,List VarSet) -> Z - ++ dimension(I,lvar) gives the dimension of the ideal I, - ++ in the ring \spad{F[lvar]} - dimension : Ideal -> Z - ++ dimension(I) gives the dimension of the ideal I. - ++ in the ring \spad{F[lvar]}, where lvar are the variables appearing in I - leadingIdeal : Ideal -> Ideal - ++ leadingIdeal(I) is the ideal generated by the - ++ leading terms of the elements of the ideal I. - ideal : List DPoly -> Ideal - ++ ideal(polyList) constructs the ideal generated by the list - ++ of polynomials polyList. - groebnerIdeal : List DPoly -> Ideal - ++ groebnerIdeal(polyList) constructs the ideal generated by the list - ++ of polynomials polyList which are assumed to be a Groebner - ++ basis. - ++ Note: this operation avoids a Groebner basis computation. - groebner? : Ideal -> Boolean - ++ groebner?(I) tests if the generators of the ideal I are a Groebner basis. - generators : Ideal -> List DPoly - ++ generators(I) returns a list of generators for the ideal I. - coerce : List DPoly -> Ideal - ++ coerce(polyList) converts the list of polynomials polyList to an ideal. - - saturate : (Ideal,DPoly) -> Ideal - ++ saturate(I,f) is the saturation of the ideal I - ++ with respect to the multiplicative - ++ set generated by the polynomial f. - saturate :(Ideal,DPoly,List VarSet) -> Ideal - ++ saturate(I,f,lvar) is the saturation with respect to the prime - ++ principal ideal which is generated by f in the polynomial ring - ++ \spad{F[lvar]}. - if VarSet has ConvertibleTo Symbol then - relationsIdeal : List DPoly -> ST - ++ relationsIdeal(polyList) returns the ideal of relations among the - ++ polynomials in polyList. - - T == add - - --- Representation --- - Rep := Record(idl:List DPoly,isGr:Boolean) - - - ---- Local Functions ---- - - contractGrob : newIdeal -> Ideal - npoly : DPoly -> newPoly - oldpoly : newPoly -> Union(DPoly,"failed") - leadterm : (DPoly,VarSet) -> DPoly - choosel : (DPoly,DPoly) -> DPoly - isMonic? : (DPoly,VarSet) -> Boolean - randomat : List Z -> Record(mM:MF,imM:MF) - monomDim : (Ideal,List VarSet) -> NNI - variables : Ideal -> List VarSet - subset : List VarSet -> List List VarSet - makeleast : (List VarSet,List VarSet) -> List VarSet - - newExpon: OrderedAbelianMonoidSup - newExpon:= Product(NNI,Expon) - newPoly := PolynomialRing(F,newExpon) - - import GaloisGroupFactorizer(SparseUnivariatePolynomial Z) - import GroebnerPackage(F,Expon,VarSet,DPoly) - import GroebnerPackage(F,newExpon,VarSet,newPoly) - - newIdeal ==> List(newPoly) - - npoly(f:DPoly) : newPoly == - f=0$DPoly => 0$newPoly - monomial(leadingCoefficient f,makeprod(0,degree f))$newPoly + - npoly(reductum f) - - oldpoly(q:newPoly) : Union(DPoly,"failed") == - q=0$newPoly => 0$DPoly - dq:newExpon:=degree q - n:NNI:=selectfirst (dq) - n^=0 => "failed" - ((g:=oldpoly reductum q) case "failed") => "failed" - monomial(leadingCoefficient q,selectsecond dq)$DPoly + (g::DPoly) - - leadterm(f:DPoly,lvar:List VarSet) : DPoly == - empty?(lf:=variables f) or lf=lvar => f - leadterm(leadingCoefficient univariate(f,lf.first),lvar) - - choosel(f:DPoly,g:DPoly) : DPoly == - g=0 => f - (f1:=f exquo g) case "failed" => f - choosel(f1::DPoly,g) - - contractGrob(I1:newIdeal) : Ideal == - J1:List(newPoly):=groebner(I1) - while (oldpoly J1.first) case "failed" repeat J1:=J1.rest - [[(oldpoly f)::DPoly for f in J1],true] - - makeleast(fullVars: List VarSet,leastVars:List VarSet) : List VarSet == - n:= # leastVars - #fullVars < n => error "wrong vars" - n=0 => fullVars - append([vv for vv in fullVars| ^member?(vv,leastVars)],leastVars) - - isMonic?(f:DPoly,x:VarSet) : Boolean == - ground? leadingCoefficient univariate(f,x) - - subset(lv : List VarSet) : List List VarSet == - #lv =1 => [lv,empty()] - v:=lv.1 - ll:=subset(rest lv) - l1:=[concat(v,set) for set in ll] - concat(l1,ll) - - monomDim(listm:Ideal,lv:List VarSet) : NNI == - monvar: List List VarSet := [] - for f in generators listm repeat - mvset := variables f - #mvset > 1 => monvar:=concat(mvset,monvar) - lv:=delete(lv,position(mvset.1,lv)) - empty? lv => 0 - lsubset : List List VarSet := sort(#(#1)>#(#2),subset(lv)) - for subs in lsubset repeat - ldif:List VarSet:= lv - for mvset in monvar while ldif ^=[] repeat - ldif:=setDifference(mvset,subs) - if ^(empty? ldif) then return #subs - 0 - - -- Exported Functions ---- - - ---- is I = J ? ---- - (I:Ideal = J:Ideal) == in?(I,J) and in?(J,I) - - ---- check if f is in I ---- - element?(f:DPoly,I:Ideal) : Boolean == - Id:=(groebner I).idl - empty? Id => f = 0 - normalForm(f,Id) = 0 - - ---- check if I is contained in J ---- - in?(I:Ideal,J:Ideal):Boolean == - J:= groebner J - empty?(I.idl) => true - "and"/[element?(f,J) for f in I.idl ] - - - ---- groebner base for an Ideal ---- - groebner(I:Ideal) : Ideal == - I.isGr => - "or"/[^zero? f for f in I.idl] => I - [empty(),true] - [groebner I.idl ,true] - - ---- Intersection of two ideals ---- - intersect(I:Ideal,J:Ideal) : Ideal == - empty?(Id:=I.idl) => I - empty?(Jd:=J.idl) => J - tp:newPoly := monomial(1,makeprod(1,0$Expon))$newPoly - tp1:newPoly:= tp-1 - contractGrob(concat([tp*npoly f for f in Id], - [tp1*npoly f for f in Jd])) - - - ---- intersection for a list of ideals ---- - - intersect(lid:List(Ideal)) : Ideal == "intersect"/[l for l in lid] - - ---- quotient by an element ---- - quotient(I:Ideal,f:DPoly) : Ideal == - --[[(g exquo f)::DPoly for g in (intersect(I,[f]::%)).idl ],true] - import GroebnerInternalPackage(F,Expon,VarSet,DPoly) - [minGbasis [(g exquo f)::DPoly - for g in (intersect(I,[f]::%)).idl ],true] - - ---- quotient of two ideals ---- - quotient(I:Ideal,J:Ideal) : Ideal == - Jdl := J.idl - empty?(Jdl) => ideal [1] - [("intersect"/[quotient(I,f) for f in Jdl ]).idl ,true] - - - ---- sum of two ideals ---- - (I:Ideal + J:Ideal) : Ideal == [groebner(concat(I.idl ,J.idl )),true] - - ---- product of two ideals ---- - (I:Ideal * J:Ideal):Ideal == - [groebner([:[f*g for f in I.idl ] for g in J.idl ]),true] - - ---- power of an ideal ---- - (I:Ideal ** n:NNI) : Ideal == - n=0 => [[1$DPoly],true] - (I * (I**(n-1):NNI)) - - ---- saturation with respect to the multiplicative set f**n ---- - saturate(I:Ideal,f:DPoly) : Ideal == - f=0 => error "f is zero" - tp:newPoly := (monomial(1,makeprod(1,0$Expon))$newPoly * npoly f)-1 - contractGrob(concat(tp,[npoly g for g in I.idl ])) - - ---- saturation with respect to a prime principal ideal in lvar --- - saturate(I:Ideal,f:DPoly,lvar:List(VarSet)) : Ideal == - Id := I.idl - fullVars := "setUnion"/[variables g for g in Id] - newVars:=makeleast(fullVars,lvar) - subVars := [monomial(1,vv,1) for vv in newVars] - J:List DPoly:=groebner([eval(g,fullVars,subVars) for g in Id]) - ltJ:=[leadterm(g,lvar) for g in J] - s:DPoly:=_*/[choosel(ltg,f) for ltg in ltJ] - fullPol:=[monomial(1,vv,1) for vv in fullVars] - [[eval(g,newVars,fullPol) for g in (saturate(J::%,s)).idl],true] - - ---- is the ideal zero dimensional? ---- - ---- in the ring F[lvar]? ---- - zeroDim?(I:Ideal,lvar:List VarSet) : Boolean == - J:=(groebner I).idl - empty? J => false - J = [1] => false - n:NNI := # lvar - #J < n => false - for f in J while ^empty?(lvar) repeat - x:=(mainVariable f)::VarSet - if isMonic?(f,x) then lvar:=delete(lvar,position(x,lvar)) - empty?(lvar) - - ---- is the ideal zero dimensional? ---- - zeroDim?(I:Ideal):Boolean == zeroDim?(I,"setUnion"/[variables g for g in I.idl]) - - ---- test if f is in the radical of I ---- - inRadical?(f:DPoly,I:Ideal) : Boolean == - f=0$DPoly => true - tp:newPoly :=(monomial(1,makeprod(1,0$Expon))$newPoly * npoly f)-1 - Id:=I.idl - normalForm(1$newPoly,groebner concat(tp,[npoly g for g in Id])) = 0 - - ---- dimension of an ideal ---- - ---- in the ring F[lvar] ---- - dimension(I:Ideal,lvar:List VarSet) : Z == - I:=groebner I - empty?(I.idl) => # lvar - element?(1,I) => -1 - truelist:="setUnion"/[variables f for f in I.idl] - "or"/[^member?(vv,lvar) for vv in truelist] => error "wrong variables" - truelist:=setDifference(lvar,setDifference(lvar,truelist)) - ed:Z:=#lvar - #truelist - leadid:=leadingIdeal(I) - n1:Z:=monomDim(leadid,truelist)::Z - ed+n1 - - dimension(I:Ideal) : Z == dimension(I,"setUnion"/[variables g for g in I.idl]) - - -- leading term ideal -- - leadingIdeal(I : Ideal) : Ideal == - Idl:= (groebner I).idl - [[(f-reductum f) for f in Idl],true] - - ---- ideal of relations among the fi ---- - if VarSet has ConvertibleTo Symbol then - - monompol(df:List NNI,lcf:F,lv:List VarSet) : P == - g:P:=lcf::P - for dd in df for v in lv repeat - g:= monomial(g,convert v,dd) - g - - relationsIdeal(listf : List DPoly): ST == - empty? listf => [empty(),empty()]$ST - nf:=#listf - lvint := "setUnion"/[variables g for g in listf] - vl: List Symbol := [convert vv for vv in lvint] - nvar:List Symbol:=[new() for i in 1..nf] - VarSet1:=OrderedVariableList(concat(vl,nvar)) - lv1:=[variable(vv)$VarSet1::VarSet1 for vv in nvar] - DirP:=DirectProduct(nf,NNI) - nExponent:=Product(Expon,DirP) - nPoly := PolynomialRing(F,nExponent) - gp:=GroebnerPackage(F,nExponent,VarSet1,nPoly) - lf:List nPoly :=[] - lp:List P:=[] - for f in listf for i in 1.. repeat - vec2:Vector(NNI):=new(nf,0$NNI) - vec2.i:=1 - g:nPoly:=0$nPoly - pol:=0$P - while f^=0 repeat - df:=degree(f-reductum f,lvint) - lcf:=leadingCoefficient f - pol:=pol+monompol(df,lcf,lvint) - g:=g+monomial(lcf,makeprod(degree f,0))$nPoly - f:=reductum f - lp:=concat(pol,lp) - lf:=concat(monomial(1,makeprod(0,directProduct vec2))-g,lf) - npol:List P :=[v::P for v in nvar] - leq : List Equation P := - [p = pol for p in npol for pol in reverse lp ] - lf:=(groebner lf)$gp - while lf^=[] repeat - q:=lf.first - dq:nExponent:=degree q - n:=selectfirst (dq) - if n=0 then leave "done" - lf:=lf.rest - solsn:List P:=[] - for q in lf repeat - g:Polynomial F :=0 - while q^=0 repeat - dq:=degree q - lcq:=leadingCoefficient q - q:=reductum q - vdq:=(selectsecond dq):Vector NNI - g:=g+ lcq* - _*/[p**vdq.j for p in npol for j in 1..] - solsn:=concat(g,solsn) - [solsn,leq]$ST - - coerce(Id:List DPoly) : Ideal == [Id,false] - - coerce(I:Ideal) : OutputForm == - Idl := I.idl - empty? Idl => [0$DPoly] :: OutputForm - Idl :: OutputForm - - ideal(Id:List DPoly) :Ideal == [[f for f in Id|f^=0],false] - - groebnerIdeal(Id:List DPoly) : Ideal == [Id,true] - - generators(I:Ideal) : List DPoly == I.idl - - groebner?(I:Ideal) : Boolean == I.isGr - - one?(I:Ideal) : Boolean == element?(1, I) - - zero?(I:Ideal) : Boolean == empty? (groebner I).idl - -@ -\section{License} -<>= ---Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. ---All rights reserved. --- ---Redistribution and use in source and binary forms, with or without ---modification, are permitted provided that the following conditions are ---met: --- --- - Redistributions of source code must retain the above copyright --- notice, this list of conditions and the following disclaimer. --- --- - Redistributions in binary form must reproduce the above copyright --- notice, this list of conditions and the following disclaimer in --- the documentation and/or other materials provided with the --- distribution. --- --- - Neither the name of The Numerical ALgorithms Group Ltd. nor the --- names of its contributors may be used to endorse or promote products --- derived from this software without specific prior written permission. --- ---THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS ---IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ---TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A ---PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER ---OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ---EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ---PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ---PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ---LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ---NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ---SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -@ -<<*>>= -<> - -<> -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document} diff --git a/src/algebra/indexedp.spad.pamphlet b/src/algebra/indexedp.spad.pamphlet deleted file mode 100644 index 12c1cdb..0000000 --- a/src/algebra/indexedp.spad.pamphlet +++ /dev/null @@ -1,310 +0,0 @@ -\documentclass{article} -\usepackage{axiom} -\begin{document} -\title{\$SPAD/src/algebra indexedp.spad} -\author{James Davenport} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject -\section{domain IDPO IndexedDirectProductObject} -<>= -)abbrev domain IDPO IndexedDirectProductObject -++ Indexed direct products of objects over a set \spad{A} -++ of generators indexed by an ordered set S. All items have finite support. -IndexedDirectProductObject(A:SetCategory,S:OrderedSet): IndexedDirectProductCategory(A,S) - == add - --representations - Term:= Record(k:S,c:A) - Rep:= List Term - --declarations - x,y: % - f: A -> A - s: S - --define - x = y == - while not null x and _^ null y repeat - x.first.k ^= y.first.k => return false - x.first.c ^= y.first.c => return false - x:=x.rest - y:=y.rest - null x and null y - - coerce(x:%):OutputForm == - bracket [rarrow(t.k :: OutputForm, t.c :: OutputForm) for t in x] - - -- sample():% == [[sample()$S,sample()$A]$Term]$Rep - - monomial(r,s) == [[s,r]] - map(f,x) == [[tm.k,f(tm.c)] for tm in x] - - reductum x == - rest x - leadingCoefficient x == - null x => error "Can't take leadingCoefficient of empty product element" - x.first.c - leadingSupport x == - null x => error "Can't take leadingCoefficient of empty product element" - x.first.k - -@ -\section{domain IDPAM IndexedDirectProductAbelianMonoid} -<>= -)abbrev domain IDPAM IndexedDirectProductAbelianMonoid -++ Indexed direct products of abelian monoids over an abelian monoid \spad{A} of -++ generators indexed by the ordered set S. All items have finite support. -++ Only non-zero terms are stored. -IndexedDirectProductAbelianMonoid(A:AbelianMonoid,S:OrderedSet): - Join(AbelianMonoid,IndexedDirectProductCategory(A,S)) - == IndexedDirectProductObject(A,S) add - --representations - Term:= Record(k:S,c:A) - Rep:= List Term - x,y: % - r: A - n: NonNegativeInteger - f: A -> A - s: S - 0 == [] - zero? x == null x - - -- PERFORMANCE CRITICAL; Should build list up - -- by merging 2 sorted lists. Doing this will - -- avoid the recursive calls (very useful if there is a - -- large number of vars in a polynomial. --- x + y == --- null x => y --- null y => x --- y.first.k > x.first.k => cons(y.first,(x + y.rest)) --- x.first.k > y.first.k => cons(x.first,(x.rest + y)) --- r:= x.first.c + y.first.c --- r = 0 => x.rest + y.rest --- cons([x.first.k,r],(x.rest + y.rest)) - qsetrest!: (Rep, Rep) -> Rep - qsetrest!(l: Rep, e: Rep): Rep == RPLACD(l, e)$Lisp - - x + y == - null x => y - null y => x - endcell: Rep := empty() - res: Rep := empty() - while not empty? x and not empty? y repeat - newcell := empty() - if x.first.k = y.first.k then - r:= x.first.c + y.first.c - if not zero? r then - newcell := cons([x.first.k, r], empty()) - x := rest x - y := rest y - else if x.first.k > y.first.k then - newcell := cons(x.first, empty()) - x := rest x - else - newcell := cons(y.first, empty()) - y := rest y - if not empty? newcell then - if not empty? endcell then - qsetrest!(endcell, newcell) - endcell := newcell - else - res := newcell; - endcell := res - if empty? x then end := y - else end := x - if empty? res then res := end - else qsetrest!(endcell, end) - res - - n * x == - n = 0 => 0 - n = 1 => x - [[u.k,a] for u in x | (a:=n*u.c) ^= 0$A] - - monomial(r,s) == (r = 0 => 0; [[s,r]]) - map(f,x) == [[tm.k,a] for tm in x | (a:=f(tm.c)) ^= 0$A] - - reductum x == (null x => 0; rest x) - leadingCoefficient x == (null x => 0; x.first.c) - -@ -\section{domain IDPOAM IndexedDirectProductOrderedAbelianMonoid} -<>= -)abbrev domain IDPOAM IndexedDirectProductOrderedAbelianMonoid -++ Indexed direct products of ordered abelian monoids \spad{A} of -++ generators indexed by the ordered set S. -++ The inherited order is lexicographical. -++ All items have finite support: only non-zero terms are stored. -IndexedDirectProductOrderedAbelianMonoid(A:OrderedAbelianMonoid,S:OrderedSet): - Join(OrderedAbelianMonoid,IndexedDirectProductCategory(A,S)) - == IndexedDirectProductAbelianMonoid(A,S) add - --representations - Term:= Record(k:S,c:A) - Rep:= List Term - x,y: % - x false - empty? x => true -- note careful order of these two lines - y.first.k > x.first.k => true - y.first.k < x.first.k => false - y.first.c > x.first.c => true - y.first.c < x.first.c => false - x.rest < y.rest - -@ -\section{domain IDPOAMS IndexedDirectProductOrderedAbelianMonoidSup} -<>= -)abbrev domain IDPOAMS IndexedDirectProductOrderedAbelianMonoidSup -++ Indexed direct products of ordered abelian monoid sups \spad{A}, -++ generators indexed by the ordered set S. -++ All items have finite support: only non-zero terms are stored. -IndexedDirectProductOrderedAbelianMonoidSup(A:OrderedAbelianMonoidSup,S:OrderedSet): - Join(OrderedAbelianMonoidSup,IndexedDirectProductCategory(A,S)) - == IndexedDirectProductOrderedAbelianMonoid(A,S) add - --representations - Term:= Record(k:S,c:A) - Rep:= List Term - x,y: % - r: A - s: S - - subtractIfCan(x,y) == - empty? y => x - empty? x => "failed" - x.first.k < y.first.k => "failed" - x.first.k > y.first.k => - t:= subtractIfCan(x.rest, y) - t case "failed" => "failed" - cons( x.first, t) - u:=subtractIfCan(x.first.c, y.first.c) - u case "failed" => "failed" - zero? u => subtractIfCan(x.rest, y.rest) - t:= subtractIfCan(x.rest, y.rest) - t case "failed" => "failed" - cons([x.first.k,u],t) - - sup(x,y) == - empty? y => x - empty? x => y - x.first.k < y.first.k => cons(y.first,sup(x,y.rest)) - x.first.k > y.first.k => cons(x.first,sup(x.rest,y)) - u:=sup(x.first.c, y.first.c) - cons([x.first.k,u],sup(x.rest,y.rest)) - -@ -\section{domain IDPAG IndexedDirectProductAbelianGroup} -<>= -)abbrev domain IDPAG IndexedDirectProductAbelianGroup -++ Indexed direct products of abelian groups over an abelian group \spad{A} of -++ generators indexed by the ordered set S. -++ All items have finite support: only non-zero terms are stored. -IndexedDirectProductAbelianGroup(A:AbelianGroup,S:OrderedSet): - Join(AbelianGroup,IndexedDirectProductCategory(A,S)) - == IndexedDirectProductAbelianMonoid(A,S) add - --representations - Term:= Record(k:S,c:A) - Rep:= List Term - x,y: % - r: A - n: Integer - f: A -> A - s: S - -x == [[u.k,-u.c] for u in x] - n * x == - n = 0 => 0 - n = 1 => x - [[u.k,a] for u in x | (a:=n*u.c) ^= 0$A] - - qsetrest!: (Rep, Rep) -> Rep - qsetrest!(l: Rep, e: Rep): Rep == RPLACD(l, e)$Lisp - - x - y == - null x => -y - null y => x - endcell: Rep := empty() - res: Rep := empty() - while not empty? x and not empty? y repeat - newcell := empty() - if x.first.k = y.first.k then - r:= x.first.c - y.first.c - if not zero? r then - newcell := cons([x.first.k, r], empty()) - x := rest x - y := rest y - else if x.first.k > y.first.k then - newcell := cons(x.first, empty()) - x := rest x - else - newcell := cons([y.first.k,-y.first.c], empty()) - y := rest y - if not empty? newcell then - if not empty? endcell then - qsetrest!(endcell, newcell) - endcell := newcell - else - res := newcell; - endcell := res - if empty? x then end := - y - else end := x - if empty? res then res := end - else qsetrest!(endcell, end) - res - --- x - y == --- empty? x => - y --- empty? y => x --- y.first.k > x.first.k => cons([y.first.k,-y.first.c],(x - y.rest)) --- x.first.k > y.first.k => cons(x.first,(x.rest - y)) --- r:= x.first.c - y.first.c --- r = 0 => x.rest - y.rest --- cons([x.first.k,r],(x.rest - y.rest)) - -@ -\section{License} -<>= ---Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. ---All rights reserved. --- ---Redistribution and use in source and binary forms, with or without ---modification, are permitted provided that the following conditions are ---met: --- --- - Redistributions of source code must retain the above copyright --- notice, this list of conditions and the following disclaimer. --- --- - Redistributions in binary form must reproduce the above copyright --- notice, this list of conditions and the following disclaimer in --- the documentation and/or other materials provided with the --- distribution. --- --- - Neither the name of The Numerical ALgorithms Group Ltd. nor the --- names of its contributors may be used to endorse or promote products --- derived from this software without specific prior written permission. --- ---THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS ---IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ---TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A ---PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER ---OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ---EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ---PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ---PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ---LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ---NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ---SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -@ -<<*>>= -<> - -<> -<> -<> -<> -<> -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document} diff --git a/src/algebra/intaux.spad.pamphlet b/src/algebra/intaux.spad.pamphlet index d8d3493..f701dc0 100644 --- a/src/algebra/intaux.spad.pamphlet +++ b/src/algebra/intaux.spad.pamphlet @@ -9,179 +9,6 @@ \eject \tableofcontents \eject -\section{domain IR IntegrationResult} -<>= -)abbrev domain IR IntegrationResult -++ The result of a transcendental integration. -++ Author: Barry Trager, Manuel Bronstein -++ Date Created: 1987 -++ Date Last Updated: 12 August 1992 -++ Description: -++ If a function f has an elementary integral g, then g can be written -++ in the form \spad{g = h + c1 log(u1) + c2 log(u2) + ... + cn log(un)} -++ where h, which is in the same field than f, is called the rational -++ part of the integral, and \spad{c1 log(u1) + ... cn log(un)} is called the -++ logarithmic part of the integral. This domain manipulates integrals -++ represented in that form, by keeping both parts separately. The logs -++ are not explicitly computed. -++ Keywords: integration. -++ Examples: )r RATINT INPUT -IntegrationResult(F:Field): Exports == Implementation where - O ==> OutputForm - B ==> Boolean - Z ==> Integer - Q ==> Fraction Integer - SE ==> Symbol - UP ==> SparseUnivariatePolynomial F - LOG ==> Record(scalar:Q, coeff:UP, logand:UP) - NE ==> Record(integrand:F, intvar:F) - - Exports ==> (Module Q, RetractableTo F) with - mkAnswer: (F, List LOG, List NE) -> % - ++ mkAnswer(r,l,ne) creates an integration result from - ++ a rational part r, a logarithmic part l, and a non-elementary part ne. - ratpart : % -> F - ++ ratpart(ir) returns the rational part of an integration result - logpart : % -> List LOG - ++ logpart(ir) returns the logarithmic part of an integration result - notelem : % -> List NE - ++ notelem(ir) returns the non-elementary part of an integration result - elem? : % -> B - ++ elem?(ir) tests if an integration result is elementary over F? - integral: (F, F) -> % - ++ integral(f,x) returns the formal integral of f with respect to x - differentiate: (%, F -> F) -> F - ++ differentiate(ir,D) differentiates ir with respect to the derivation D. - if F has PartialDifferentialRing(SE) then - differentiate: (%, Symbol) -> F - ++ differentiate(ir,x) differentiates ir with respect to x - if F has RetractableTo Symbol then - integral: (F, Symbol) -> % - ++ integral(f,x) returns the formal integral of f with respect to x - - Implementation ==> add - Rep := Record(ratp: F, logp: List LOG, nelem: List NE) - - timelog : (Q, LOG) -> LOG - timene : (Q, NE) -> NE - LOG2O : LOG -> O - NE2O : NE -> O - Q2F : Q -> F - nesimp : List NE -> List NE - neselect: (List NE, F) -> F - pLogDeriv: (LOG, F -> F) -> F - pNeDeriv : (NE, F -> F) -> F - - - alpha:O := new()$Symbol :: O - - - u == (-1$Z) * u - 0 == mkAnswer(0, empty(), empty()) - coerce(x:F):% == mkAnswer(x, empty(), empty()) - ratpart u == u.ratp - logpart u == u.logp - notelem u == u.nelem - elem? u == empty? notelem u - mkAnswer(x, l, n) == [x, l, nesimp n] - timelog(r, lg) == [r * lg.scalar, lg.coeff, lg.logand] - integral(f:F,x:F) == (zero? f => 0; mkAnswer(0, empty(), [[f, x]])) - timene(r, ne) == [Q2F(r) * ne.integrand, ne.intvar] - n:Z * u:% == (n::Q) * u - Q2F r == numer(r)::F / denom(r)::F - neselect(l, x) == _+/[ne.integrand for ne in l | ne.intvar = x] - - if F has RetractableTo Symbol then - integral(f:F, x:Symbol):% == integral(f, x::F) - - LOG2O rec == --- one? degree rec.coeff => - (degree rec.coeff) = 1 => - -- deg 1 minimal poly doesn't get sigma - lastc := - coefficient(rec.coeff, 0) / coefficient(rec.coeff, 1) - lg := (rec.logand) lastc - logandp := prefix("log"::Symbol::O, [lg::O]) - (cc := Q2F(rec.scalar) * lastc) = 1 => logandp - cc = -1 => - logandp - cc::O * logandp - coeffp:O := (outputForm(rec.coeff, alpha) = 0::Z::O)@O - logandp := - alpha * prefix("log"::Symbol::O, [outputForm(rec.logand, alpha)]) - if (cc := Q2F(rec.scalar)) ^= 1 then - logandp := cc::O * logandp - sum(logandp, coeffp) - - nesimp l == - [[u,x] for x in removeDuplicates_!([ne.intvar for ne in l]$List(F)) - | (u := neselect(l, x)) ^= 0] - - if (F has LiouvillianFunctionCategory) and (F has RetractableTo Symbol) then - retractIfCan u == - empty? logpart u => - ratpart u + - _+/[integral(ne.integrand, retract(ne.intvar)@Symbol)$F - for ne in notelem u] - "failed" - - else - retractIfCan u == - elem? u and empty? logpart u => ratpart u - "failed" - - r:Q * u:% == - r = 0 => 0 - mkAnswer(Q2F(r) * ratpart u, map(timelog(r, #1), logpart u), - map(timene(r, #1), notelem u)) - - -- Initial attempt, quick and dirty, no simplification - u + v == - mkAnswer(ratpart u + ratpart v, concat(logpart u, logpart v), - nesimp concat(notelem u, notelem v)) - - if F has PartialDifferentialRing(Symbol) then - differentiate(u:%, x:Symbol):F == differentiate(u, differentiate(#1, x)) - - differentiate(u:%, derivation:F -> F):F == - derivation ratpart u + - _+/[pLogDeriv(log, derivation) for log in logpart u] - + _+/[pNeDeriv(ne, derivation) for ne in notelem u] - - pNeDeriv(ne, derivation) == --- one? derivation(ne.intvar) => ne.integrand - (derivation(ne.intvar) = 1) => ne.integrand - zero? derivation(ne.integrand) => 0 - error "pNeDeriv: cannot differentiate not elementary part into F" - - pLogDeriv(log, derivation) == - map(derivation, log.coeff) ^= 0 => - error "pLogDeriv: can only handle logs with constant coefficients" --- one?(n := degree(log.coeff)) => - ((n := degree(log.coeff)) = 1) => - c := - (leadingCoefficient reductum log.coeff) - / (leadingCoefficient log.coeff) - ans := (log.logand) c - Q2F(log.scalar) * c * derivation(ans) / ans - numlog := map(derivation, log.logand) - diflog := extendedEuclidean(log.logand, log.coeff, - numlog)::Record(coef1:UP, coef2:UP) - algans := diflog.coef1 - ans:F := 0 - for i in 0..(n-1) repeat - algans := algans * monomial(1, 1) rem log.coeff - ans := ans + coefficient(algans, i) - Q2F(log.scalar) * ans - - coerce(u:%):O == - (r := retractIfCan u) case F => r::F::O - l := reverse_! [LOG2O f for f in logpart u]$List(O) - if ratpart u ^= 0 then l := concat(ratpart(u)::O, l) - if not elem? u then l := concat([NE2O f for f in notelem u], l) - null l => 0::O - reduce("+", l) - - NE2O ne == - int((ne.integrand)::O * hconcat ["d"::Symbol::O, (ne.intvar)::O]) - -@ \section{package IR2 IntegrationResultFunctions2} <>= )abbrev package IR2 IntegrationResultFunctions2 @@ -289,7 +116,6 @@ IntegrationResultFunctions2(E, F): Exports == Implementation where -- -- INTAUX rderf intrf rdeef intef irexpand integrat -<> <> @ \eject diff --git a/src/algebra/integer.spad.pamphlet b/src/algebra/integer.spad.pamphlet index 16ac727..4632e79 100644 --- a/src/algebra/integer.spad.pamphlet +++ b/src/algebra/integer.spad.pamphlet @@ -57,1708 +57,6 @@ IntegerSolveLinearPolynomialEquation(): C ==T answer @ -\section{domain INT Integer} -The function {\bf one?} has been rewritten back to its original form. -The NAG version called a lisp primitive that exists only in Codemist -Common Lisp and is not defined in Common Lisp. -<>= --- integer.spad.pamphlet Integer.input -)spool Integer.output -)set message test on -)set message auto off -)clear all ---S 1 of 42 -2**(5678 - 4856 + 2 * 17) ---R ---R ---R (1) ---R 4804810770435008147181540925125924391239526139871682263473855610088084200076_ ---R 308293086342527091412083743074572278211496076276922026433435687527334980249_ ---R 539302425425230458177649495442143929053063884787051467457680738771416988598_ ---R 15495632935288783334250628775936 ---R Type: PositiveInteger ---E 1 - ---S 2 of 42 -x := -101 ---R ---R ---R (2) - 101 ---R Type: Integer ---E 2 - ---S 3 of 42 -abs(x) ---R ---R ---R (3) 101 ---R Type: PositiveInteger ---E 3 - ---S 4 of 42 -sign(x) ---R ---R ---R (4) - 1 ---R Type: Integer ---E 4 - ---S 5 of 42 -x < 0 ---R ---R ---R (5) true ---R Type: Boolean ---E 5 - ---S 6 of 42 -x <= -1 ---R ---R ---R (6) true ---R Type: Boolean ---E 6 - ---S 7 of 42 -negative?(x) ---R ---R ---R (7) true ---R Type: Boolean ---E 7 - ---S 8 of 42 -x > 0 ---R ---R ---R (8) false ---R Type: Boolean ---E 8 - ---S 9 of 42 -x >= 1 ---R ---R ---R (9) false ---R Type: Boolean ---E 9 - ---S 10 of 42 -positive?(x) ---R ---R ---R (10) false ---R Type: Boolean ---E 10 - ---S 11 of 42 -zero?(x) ---R ---R ---R (11) false ---R Type: Boolean ---E 11 - ---S 12 of 42 -one?(x) ---R ---R ---R (12) false ---R Type: Boolean ---E 12 - ---S 13 of 42 -(x = -101)@Boolean ---R ---R ---R (13) true ---R Type: Boolean ---E 13 - ---S 14 of 42 -odd?(x) ---R ---R ---R (14) true ---R Type: Boolean ---E 14 - ---S 15 of 42 -even?(x) ---R ---R ---R (15) false ---R Type: Boolean ---E 15 - ---S 16 of 42 -gcd(56788,43688) ---R ---R ---R (16) 4 ---R Type: PositiveInteger ---E 16 - ---S 17 of 42 -lcm(56788,43688) ---R ---R ---R (17) 620238536 ---R Type: PositiveInteger ---E 17 - ---S 18 of 42 -max(678,567) ---R ---R ---R (18) 678 ---R Type: PositiveInteger ---E 18 - ---S 19 of 42 -min(678,567) ---R ---R ---R (19) 567 ---R Type: PositiveInteger ---E 19 - ---S 20 of 42 -reduce(max,[2,45,-89,78,100,-45]) ---R ---R ---R (20) 100 ---R Type: PositiveInteger ---E 20 - ---S 21 of 42 -reduce(min,[2,45,-89,78,100,-45]) ---R ---R ---R (21) - 89 ---R Type: Integer ---E 21 - ---S 22 of 42 -reduce(gcd,[2,45,-89,78,100,-45]) ---R ---R ---R (22) 1 ---R Type: PositiveInteger ---E 22 - ---S 23 of 42 -reduce(lcm,[2,45,-89,78,100,-45]) ---R ---R ---R (23) 1041300 ---R Type: PositiveInteger ---E 23 - ---S 24 of 42 -13 / 4 ---R ---R ---R 13 ---R (24) -- ---R 4 ---R Type: Fraction Integer ---E 24 - ---S 25 of 42 -13 quo 4 ---R ---R ---R (25) 3 ---R Type: PositiveInteger ---E 25 - ---S 26 of 42 -13 rem 4 ---R ---R ---R (26) 1 ---R Type: PositiveInteger ---E 26 - ---S 27 of 42 -zero?(167604736446952 rem 2003644) ---R ---R ---R (27) true ---R Type: Boolean ---E 27 - ---S 28 of 42 -d := divide(13,4) ---R ---R ---R (28) [quotient= 3,remainder= 1] ---R Type: Record(quotient: Integer,remainder: Integer) ---E 28 - ---S 29 of 42 -d.quotient ---R ---R ---R (29) 3 ---R Type: PositiveInteger ---E 29 - ---S 30 of 42 -d.remainder ---R ---R ---R (30) 1 ---R Type: PositiveInteger ---E 30 - ---S 31 of 42 -factor 102400 ---R ---R ---R 12 2 ---R (31) 2 5 ---R Type: Factored Integer ---E 31 - ---S 32 of 42 -prime? 7 ---R ---R ---R (32) true ---R Type: Boolean ---E 32 - ---S 33 of 42 -prime? 8 ---R ---R ---R (33) false ---R Type: Boolean ---E 33 - ---S 34 of 42 -nextPrime 100 ---R ---R ---R (34) 101 ---R Type: PositiveInteger ---E 34 - ---S 35 of 42 -prevPrime 100 ---R ---R ---R (35) 97 ---R Type: PositiveInteger ---E 35 - ---S 36 of 42 -primes(100,175) ---R ---R ---R (36) [173,167,163,157,151,149,139,137,131,127,113,109,107,103,101] ---R Type: List Integer ---E 36 - ---S 37 of 42 -factor(2 :: Complex Integer) ---R ---R ---R 2 ---R (37) - %i (1 + %i) ---R Type: Factored Complex Integer ---E 37 - ---S 38 of 42 -[fibonacci(k) for k in 0..] ---R ---R ---R (38) [0,1,1,2,3,5,8,13,21,34,...] ---R Type: Stream Integer ---E 38 - ---S 39 of 42 -[legendre(i,11) for i in 0..10] ---R ---R ---R (39) [0,1,- 1,1,1,1,- 1,- 1,- 1,1,- 1] ---R Type: List Integer ---E 39 - ---S 40 of 42 -[jacobi(i,15) for i in 0..9] ---R ---R ---R (40) [0,1,1,0,1,0,0,- 1,1,0] ---R Type: List Integer ---E 40 - ---S 41 of 42 -[eulerPhi i for i in 1..] ---R ---R ---R (41) [1,1,2,2,4,2,6,4,6,4,...] ---R Type: Stream Integer ---E 41 - ---S 42 of 42 -[moebiusMu i for i in 1..] ---R ---R ---R (42) [1,- 1,- 1,0,- 1,1,- 1,0,0,1,...] ---R Type: Stream Integer ---E 42 -)spool -)lisp (bye) -@ -<>= -==================================================================== -Integer examples -==================================================================== - -Axiom provides many operations for manipulating arbitrary precision -integers. In this section we will show some of those that come from -Integer itself plus some that are implemented in other packages. - -\subsection{Basic Functions} - -The size of an integer in Axiom is only limited by the amount of -computer storage you have available. The usual arithmetic operations -are available. - - 2**(5678 - 4856 + 2 * 17) - 4804810770435008147181540925125924391239526139871682263473855610088084200076_ - 308293086342527091412083743074572278211496076276922026433435687527334980249_ - 539302425425230458177649495442143929053063884787051467457680738771416988598_ - 15495632935288783334250628775936 - Type: PositiveInteger - -There are a number of ways of working with the sign of an integer. -Let's use this x as an example. - - x := -101 - - 101 - Type: Integer - -First of all, there is the absolute value function. - - abs(x) - 101 - Type: PositiveInteger - -The sign operation returns -1 if its argument is negative, 0 if zero -and 1 if positive. - - sign(x) - - 1 - Type: Integer - -You can determine if an integer is negative in several other ways. - - x < 0 - true - Type: Boolean - - x <= -1 - true - Type: Boolean - - negative?(x) - true - Type: Boolean - -Similarly, you can find out if it is positive. - - x > 0 - false - Type: Boolean - - x >= 1 - false - Type: Boolean - - positive?(x) - false - Type: Boolean - -This is the recommended way of determining whether an integer is zero. - - zero?(x) - false - Type: Boolean - -Use the zero? operation whenever you are testing any mathematical -object for equality with zero. This is usually more efficient that -using = (think of matrices: it is easier to tell if a matrix is zero -by just checking term by term than constructing another "zero" matrix -and comparing the two matrices term by term) and also avoids the -problem that = is usually used for creating equations. - -This is the recommended way of determining whether an integer is equal -to one. - - one?(x) - false - Type: Boolean - -This syntax is used to test equality using =. It says that you want a -Boolean (true or false) answer rather than an equation. - - (x = -101)@Boolean - true - Type: Boolean - -The operations odd? and even? determine whether an integer is odd or -even, respectively. They each return a Boolean object. - - odd?(x) - true - Type: Boolean - - even?(x) - false - Type: Boolean - -The operation gcd computes the greatest common divisor of two integers. - - gcd(56788,43688) - 4 - Type: PositiveInteger - -The operation lcm computes their least common multiple. - - lcm(56788,43688) - 620238536 - Type: PositiveInteger - -To determine the maximum of two integers, use max. - - max(678,567) - 678 - Type: PositiveInteger - -To determine the minimum, use min. - - min(678,567) - 567 - Type: PositiveInteger - -The reduce operation is used to extend binary operations to more -than two arguments. For example, you can use reduce to find the -maximum integer in a list or compute the least common multiple of all -integers in the list. - - reduce(max,[2,45,-89,78,100,-45]) - 100 - Type: PositiveInteger - - reduce(min,[2,45,-89,78,100,-45]) - - 89 - Type: Integer - - reduce(gcd,[2,45,-89,78,100,-45]) - 1 - Type: PositiveInteger - - reduce(lcm,[2,45,-89,78,100,-45]) - 1041300 - Type: PositiveInteger - -The infix operator "/" is not used to compute the quotient of integers. -Rather, it is used to create rational numbers as described in Fraction. - - 13 / 4 - 13 - -- - 4 - Type: Fraction Integer - -The infix operation quo computes the integer quotient. - - 13 quo 4 - 3 - Type: PositiveInteger - -The infix operation rem computes the integer remainder. - - 13 rem 4 - 1 - Type: PositiveInteger - -One integer is evenly divisible by another if the remainder is zero. -The operation exquo can also be used. - - zero?(167604736446952 rem 2003644) - true - Type: Boolean - -The operation divide returns a record of the quotient and remainder -and thus is more efficient when both are needed. - - d := divide(13,4) - [quotient= 3,remainder= 1] - Type: Record(quotient: Integer,remainder: Integer) - - d.quotient - 3 - Type: PositiveInteger - -See help on Records for details on Records. - - d.remainder - 1 - Type: PositiveInteger - -==================================================================== -Primes and Factorization -==================================================================== - -Use the operation factor to factor integers. It returns an object of -type Factored Integer. - - factor 102400 - 12 2 - 2 5 - Type: Factored Integer - -The operation prime? returns true or false depending on whether its -argument is a prime. - - prime? 7 - true - Type: Boolean - - prime? 8 - false - Type: Boolean - -The operation nextPrime returns the least prime number greater than -its argument. - - nextPrime 100 - 101 - Type: PositiveInteger - -The operation prevPrime returns the greatest prime number less than -its argument. - - prevPrime 100 - 97 - Type: PositiveInteger - -To compute all primes between two integers (inclusively), use the -operation primes. - - primes(100,175) - [173,167,163,157,151,149,139,137,131,127,113,109,107,103,101] - Type: List Integer - -You might sometimes want to see the factorization of an integer -when it is considered a Gaussian integer. - - factor(2 :: Complex Integer) - 2 - - %i (1 + %i) - Type: Factored Complex Integer - -==================================================================== -Some Number Theoretic Functions -==================================================================== - -Axiom provides several number theoretic operations for integers. - -The operation fibonacci computes the Fibonacci numbers. The algorithm -has running time O(log^3n) for argument n. - - [fibonacci(k) for k in 0..] - [0,1,1,2,3,5,8,13,21,34,...] - Type: Stream Integer - -The operation legendre computes the Legendre symbol for its two integer -arguments where the second one is prime. If you know the second argument -to be prime, use jacobi instead where no check is made. - - [legendre(i,11) for i in 0..10] - [0,1,- 1,1,1,1,- 1,- 1,- 1,1,- 1] - Type: List Integer - -The operation jacobi computes the Jacobi symbol for its two integer -arguments. By convention, 0 is returned if the greatest common divisor -of the numerator and denominator is not 1. - - [jacobi(i,15) for i in 0..9] - [0,1,1,0,1,0,0,- 1,1,0] - Type: List Integer - -The operation eulerPhi computes the values of Euler's \phi-function -where \phi(n) equals the number of positive integers less than or equal -to n that are relatively prime to the positive integer n. - - [eulerPhi i for i in 1..] - [1,1,2,2,4,2,6,4,6,4,...] - Type: Stream Integer - -The operation moebiusMu computes the Moebius mu function. - - [moebiusMu i for i in 1..] - [1,- 1,- 1,0,- 1,1,- 1,0,0,1,...] - Type: Stream Integer - - -See Also: -o )help Complex -o )help Factored -o )help Records -o )help Fraction -o )help RadixExpansion -o )help HexadecimalExpansion -o )help BinaryExpansion -o )help DecimalExpansion -o )help IntegerNumberTheoryFunctions -o )help RomanNumeral -o )show Integer -o $AXIOM/doc/src/algebra/integer.spad.dvi - -@ -<>= -)abbrev domain INT Integer -++ Author: -++ Date Created: -++ Change History: -++ Basic Operations: -++ Related Constructors: -++ Keywords: integer -++ Description: \spadtype{Integer} provides the domain of arbitrary precision -++ integers. - -Integer: Join(IntegerNumberSystem, ConvertibleTo String, OpenMath) with - random : % -> % - ++ random(n) returns a random integer from 0 to \spad{n-1}. - canonical - ++ mathematical equality is data structure equality. - canonicalsClosed - ++ two positives multiply to give positive. - noetherian - ++ ascending chain condition on ideals. - infinite - ++ nextItem never returns "failed". - == add - ZP ==> SparseUnivariatePolynomial % - ZZP ==> SparseUnivariatePolynomial Integer - x,y: % - n: NonNegativeInteger - - writeOMInt(dev: OpenMathDevice, x: %): Void == - if x < 0 then - OMputApp(dev) - OMputSymbol(dev, "arith1", "unary__minus") - OMputInteger(dev, (-x) pretend Integer) - OMputEndApp(dev) - else - OMputInteger(dev, x pretend Integer) - - OMwrite(x: %): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML) - OMputObject(dev) - writeOMInt(dev, x) - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(x: %, wholeObj: Boolean): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML) - if wholeObj then - OMputObject(dev) - writeOMInt(dev, x) - if wholeObj then - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(dev: OpenMathDevice, x: %): Void == - OMputObject(dev) - writeOMInt(dev, x) - OMputEndObject(dev) - - OMwrite(dev: OpenMathDevice, x: %, wholeObj: Boolean): Void == - if wholeObj then - OMputObject(dev) - writeOMInt(dev, x) - if wholeObj then - OMputEndObject(dev) - - zero? x == ZEROP(x)$Lisp --- one? x == ONEP(x)$Lisp - one? x == x = 1 - 0 == 0$Lisp - 1 == 1$Lisp - base() == 2$Lisp - copy x == x - inc x == x + 1 - dec x == x - 1 - hash x == SXHASH(x)$Lisp - negative? x == MINUSP(x)$Lisp - coerce(x):OutputForm == outputForm(x pretend Integer) - coerce(m:Integer):% == m pretend % - convert(x:%):Integer == x pretend Integer - length a == INTEGER_-LENGTH(a)$Lisp - addmod(a, b, p) == - (c:=a + b) >= p => c - p - c - submod(a, b, p) == - (c:=a - b) < 0 => c + p - c - mulmod(a, b, p) == (a * b) rem p - convert(x:%):Float == coerce(x pretend Integer)$Float - convert(x:%):DoubleFloat == coerce(x pretend Integer)$DoubleFloat - convert(x:%):InputForm == convert(x pretend Integer)$InputForm - convert(x:%):String == string(x pretend Integer)$String - - latex(x:%):String == - s : String := string(x pretend Integer)$String - (-1 < (x pretend Integer)) and ((x pretend Integer) < 10) => s - concat("{", concat(s, "}")$String)$String - - positiveRemainder(a, b) == - negative?(r := a rem b) => - negative? b => r - b - r + b - r - - reducedSystem(m:Matrix %):Matrix(Integer) == - m pretend Matrix(Integer) - - reducedSystem(m:Matrix %, v:Vector %): - Record(mat:Matrix(Integer), vec:Vector(Integer)) == - [m pretend Matrix(Integer), vec pretend Vector(Integer)] - - abs(x) == ABS(x)$Lisp - random() == random()$Lisp - random(x) == RANDOM(x)$Lisp - x = y == EQL(x,y)$Lisp - x < y == (x "failed" - zero?(x rem y) => x quo y - "failed" --- recip(x) == if one? x or x=-1 then x else "failed" - recip(x) == if (x = 1) or x=-1 then x else "failed" - gcd(x,y) == GCD(x,y)$Lisp - UCA ==> Record(unit:%,canonical:%,associate:%) - unitNormal x == - x < 0 => [-1,-x,-1]$UCA - [1,x,1]$UCA - unitCanonical x == abs x - solveLinearPolynomialEquation(lp:List ZP,p:ZP):Union(List ZP,"failed") == - solveLinearPolynomialEquation(lp pretend List ZZP, - p pretend ZZP)$IntegerSolveLinearPolynomialEquation pretend - Union(List ZP,"failed") - squareFreePolynomial(p:ZP):Factored ZP == - squareFree(p)$UnivariatePolynomialSquareFree(%,ZP) - factorPolynomial(p:ZP):Factored ZP == - -- GaloisGroupFactorizer doesn't factor the content - -- so we have to do this by hand - pp:=primitivePart p - leadingCoefficient pp = leadingCoefficient p => - factor(p)$GaloisGroupFactorizer(ZP) - mergeFactors(factor(pp)$GaloisGroupFactorizer(ZP), - map(#1::ZP, - factor((leadingCoefficient p exquo - leadingCoefficient pp) - ::%))$FactoredFunctions2(%,ZP) - )$FactoredFunctionUtilities(ZP) - factorSquareFreePolynomial(p:ZP):Factored ZP == - factorSquareFree(p)$GaloisGroupFactorizer(ZP) - gcdPolynomial(p:ZP, q:ZP):ZP == - zero? p => unitCanonical q - zero? q => unitCanonical p - gcd([p,q])$HeuGcd(ZP) --- myNextPrime: (%,NonNegativeInteger) -> % --- myNextPrime(x,n) == --- nextPrime(x)$IntegerPrimesPackage(%) --- TT:=InnerModularGcd(%,ZP,67108859 pretend %,myNextPrime) --- gcdPolynomial(p,q) == modularGcd(p,q)$TT - -@ -\section{INT.lsp BOOTSTRAP} -{\bf INT} depends on {\bf OINTDOM} which depends on {\bf ORDRING} -which depends on {\bf INT}. -We need to break this cycle to build -the algebra. So we keep a cached copy of the translated {\bf INT} -category which we can write into the {\bf MID} directory. We compile -the lisp code and copy the {\bf INT.o} file to the {\bf OUT} directory. -This is eventually forcibly replaced by a recompiled version. - -Note that this code is not included in the generated catdef.spad file. - -<>= - -(|/VERSIONCHECK| 2) - -(DEFUN |INT;writeOMInt| (|dev| |x| |$|) (SEQ (COND ((|<| |x| 0) (SEQ (SPADCALL |dev| (QREFELT |$| 8)) (SPADCALL |dev| "arith1" "unary_minus" (QREFELT |$| 10)) (SPADCALL |dev| (|-| |x|) (QREFELT |$| 12)) (EXIT (SPADCALL |dev| (QREFELT |$| 13))))) ((QUOTE T) (SPADCALL |dev| |x| (QREFELT |$| 12)))))) - -(DEFUN |INT;OMwrite;$S;2| (|x| |$|) (PROG (|sp| |dev| |s|) (RETURN (SEQ (LETT |s| "" |INT;OMwrite;$S;2|) (LETT |sp| (|OM-STRINGTOSTRINGPTR| |s|) |INT;OMwrite;$S;2|) (LETT |dev| (SPADCALL |sp| (SPADCALL (QREFELT |$| 15)) (QREFELT |$| 16)) |INT;OMwrite;$S;2|) (SPADCALL |dev| (QREFELT |$| 17)) (|INT;writeOMInt| |dev| |x| |$|) (SPADCALL |dev| (QREFELT |$| 18)) (SPADCALL |dev| (QREFELT |$| 19)) (LETT |s| (|OM-STRINGPTRTOSTRING| |sp|) |INT;OMwrite;$S;2|) (EXIT |s|))))) - -(DEFUN |INT;OMwrite;$BS;3| (|x| |wholeObj| |$|) (PROG (|sp| |dev| |s|) (RETURN (SEQ (LETT |s| "" |INT;OMwrite;$BS;3|) (LETT |sp| (|OM-STRINGTOSTRINGPTR| |s|) |INT;OMwrite;$BS;3|) (LETT |dev| (SPADCALL |sp| (SPADCALL (QREFELT |$| 15)) (QREFELT |$| 16)) |INT;OMwrite;$BS;3|) (COND (|wholeObj| (SPADCALL |dev| (QREFELT |$| 17)))) (|INT;writeOMInt| |dev| |x| |$|) (COND (|wholeObj| (SPADCALL |dev| (QREFELT |$| 18)))) (SPADCALL |dev| (QREFELT |$| 19)) (LETT |s| (|OM-STRINGPTRTOSTRING| |sp|) |INT;OMwrite;$BS;3|) (EXIT |s|))))) - -(DEFUN |INT;OMwrite;Omd$V;4| (|dev| |x| |$|) (SEQ (SPADCALL |dev| (QREFELT |$| 17)) (|INT;writeOMInt| |dev| |x| |$|) (EXIT (SPADCALL |dev| (QREFELT |$| 18))))) - -(DEFUN |INT;OMwrite;Omd$BV;5| (|dev| |x| |wholeObj| |$|) (SEQ (COND (|wholeObj| (SPADCALL |dev| (QREFELT |$| 17)))) (|INT;writeOMInt| |dev| |x| |$|) (EXIT (COND (|wholeObj| (SPADCALL |dev| (QREFELT |$| 18))))))) - -(PUT (QUOTE |INT;zero?;$B;6|) (QUOTE |SPADreplace|) (QUOTE ZEROP)) - -(DEFUN |INT;zero?;$B;6| (|x| |$|) (ZEROP |x|)) - -(PUT (QUOTE |INT;Zero;$;7|) (QUOTE |SPADreplace|) (QUOTE (XLAM NIL 0))) - -(DEFUN |INT;Zero;$;7| (|$|) 0) - -(PUT (QUOTE |INT;One;$;8|) (QUOTE |SPADreplace|) (QUOTE (XLAM NIL 1))) - -(DEFUN |INT;One;$;8| (|$|) 1) - -(PUT (QUOTE |INT;base;$;9|) (QUOTE |SPADreplace|) (QUOTE (XLAM NIL 2))) - -(DEFUN |INT;base;$;9| (|$|) 2) - -(PUT (QUOTE |INT;copy;2$;10|) (QUOTE |SPADreplace|) (QUOTE (XLAM (|x|) |x|))) - -(DEFUN |INT;copy;2$;10| (|x| |$|) |x|) - -(PUT (QUOTE |INT;inc;2$;11|) (QUOTE |SPADreplace|) (QUOTE (XLAM (|x|) (|+| |x| 1)))) - -(DEFUN |INT;inc;2$;11| (|x| |$|) (|+| |x| 1)) - -(PUT (QUOTE |INT;dec;2$;12|) (QUOTE |SPADreplace|) (QUOTE (XLAM (|x|) (|-| |x| 1)))) - -(DEFUN |INT;dec;2$;12| (|x| |$|) (|-| |x| 1)) - -(PUT (QUOTE |INT;hash;2$;13|) (QUOTE |SPADreplace|) (QUOTE SXHASH)) - -(DEFUN |INT;hash;2$;13| (|x| |$|) (SXHASH |x|)) - -(PUT (QUOTE |INT;negative?;$B;14|) (QUOTE |SPADreplace|) (QUOTE MINUSP)) - -(DEFUN |INT;negative?;$B;14| (|x| |$|) (MINUSP |x|)) - -(DEFUN |INT;coerce;$Of;15| (|x| |$|) (SPADCALL |x| (QREFELT |$| 35))) - -(PUT (QUOTE |INT;coerce;2$;16|) (QUOTE |SPADreplace|) (QUOTE (XLAM (|m|) |m|))) - -(DEFUN |INT;coerce;2$;16| (|m| |$|) |m|) - -(PUT (QUOTE |INT;convert;2$;17|) (QUOTE |SPADreplace|) (QUOTE (XLAM (|x|) |x|))) - -(DEFUN |INT;convert;2$;17| (|x| |$|) |x|) - -(PUT (QUOTE |INT;length;2$;18|) (QUOTE |SPADreplace|) (QUOTE |INTEGER-LENGTH|)) - -(DEFUN |INT;length;2$;18| (|a| |$|) (|INTEGER-LENGTH| |a|)) - -(DEFUN |INT;addmod;4$;19| (|a| |b| |p| |$|) (PROG (|c| #1=#:G86338) (RETURN (SEQ (EXIT (SEQ (SEQ (LETT |c| (|+| |a| |b|) |INT;addmod;4$;19|) (EXIT (COND ((NULL (|<| |c| |p|)) (PROGN (LETT #1# (|-| |c| |p|) |INT;addmod;4$;19|) (GO #1#)))))) (EXIT |c|))) #1# (EXIT #1#))))) - -(DEFUN |INT;submod;4$;20| (|a| |b| |p| |$|) (PROG (|c|) (RETURN (SEQ (LETT |c| (|-| |a| |b|) |INT;submod;4$;20|) (EXIT (COND ((|<| |c| 0) (|+| |c| |p|)) ((QUOTE T) |c|))))))) - -(DEFUN |INT;mulmod;4$;21| (|a| |b| |p| |$|) (REMAINDER2 (|*| |a| |b|) |p|)) - -(DEFUN |INT;convert;$F;22| (|x| |$|) (SPADCALL |x| (QREFELT |$| 44))) - -(PUT (QUOTE |INT;convert;$Df;23|) (QUOTE |SPADreplace|) (QUOTE (XLAM (|x|) (FLOAT |x| |MOST-POSITIVE-LONG-FLOAT|)))) - -(DEFUN |INT;convert;$Df;23| (|x| |$|) (FLOAT |x| |MOST-POSITIVE-LONG-FLOAT|)) - -(DEFUN |INT;convert;$If;24| (|x| |$|) (SPADCALL |x| (QREFELT |$| 49))) - -(PUT (QUOTE |INT;convert;$S;25|) (QUOTE |SPADreplace|) (QUOTE STRINGIMAGE)) - -(DEFUN |INT;convert;$S;25| (|x| |$|) (STRINGIMAGE |x|)) - -(DEFUN |INT;latex;$S;26| (|x| |$|) (PROG (|s|) (RETURN (SEQ (LETT |s| (STRINGIMAGE |x|) |INT;latex;$S;26|) (COND ((|<| -1 |x|) (COND ((|<| |x| 10) (EXIT |s|))))) (EXIT (STRCONC "{" (STRCONC |s| "}"))))))) - -(DEFUN |INT;positiveRemainder;3$;27| (|a| |b| |$|) (PROG (|r|) (RETURN (COND ((MINUSP (LETT |r| (REMAINDER2 |a| |b|) |INT;positiveRemainder;3$;27|)) (COND ((MINUSP |b|) (|-| |r| |b|)) ((QUOTE T) (|+| |r| |b|)))) ((QUOTE T) |r|))))) - -(PUT (QUOTE |INT;reducedSystem;2M;28|) (QUOTE |SPADreplace|) (QUOTE (XLAM (|m|) |m|))) - -(DEFUN |INT;reducedSystem;2M;28| (|m| |$|) |m|) - -(DEFUN |INT;reducedSystem;MVR;29| (|m| |v| |$|) (CONS |m| (QUOTE |vec|))) - -(PUT (QUOTE |INT;abs;2$;30|) (QUOTE |SPADreplace|) (QUOTE ABS)) - -(DEFUN |INT;abs;2$;30| (|x| |$|) (ABS |x|)) - -(PUT (QUOTE |INT;random;$;31|) (QUOTE |SPADreplace|) (QUOTE |random|)) - -(DEFUN |INT;random;$;31| (|$|) (|random|)) - -(PUT (QUOTE |INT;random;2$;32|) (QUOTE |SPADreplace|) (QUOTE RANDOM)) - -(DEFUN |INT;random;2$;32| (|x| |$|) (RANDOM |x|)) - -(PUT (QUOTE |INT;=;2$B;33|) (QUOTE |SPADreplace|) (QUOTE EQL)) - -(DEFUN |INT;=;2$B;33| (|x| |y| |$|) (EQL |x| |y|)) - -(PUT (QUOTE |INT;<;2$B;34|) (QUOTE |SPADreplace|) (QUOTE |<|)) - -(DEFUN |INT;<;2$B;34| (|x| |y| |$|) (|<| |x| |y|)) - -(PUT (QUOTE |INT;-;2$;35|) (QUOTE |SPADreplace|) (QUOTE |-|)) - -(DEFUN |INT;-;2$;35| (|x| |$|) (|-| |x|)) - -(PUT (QUOTE |INT;+;3$;36|) (QUOTE |SPADreplace|) (QUOTE |+|)) - -(DEFUN |INT;+;3$;36| (|x| |y| |$|) (|+| |x| |y|)) - -(PUT (QUOTE |INT;-;3$;37|) (QUOTE |SPADreplace|) (QUOTE |-|)) - -(DEFUN |INT;-;3$;37| (|x| |y| |$|) (|-| |x| |y|)) - -(PUT (QUOTE |INT;*;3$;38|) (QUOTE |SPADreplace|) (QUOTE |*|)) - -(DEFUN |INT;*;3$;38| (|x| |y| |$|) (|*| |x| |y|)) - -(PUT (QUOTE |INT;*;3$;39|) (QUOTE |SPADreplace|) (QUOTE |*|)) - -(DEFUN |INT;*;3$;39| (|m| |y| |$|) (|*| |m| |y|)) - -(PUT (QUOTE |INT;**;$Nni$;40|) (QUOTE |SPADreplace|) (QUOTE EXPT)) - -(DEFUN |INT;**;$Nni$;40| (|x| |n| |$|) (EXPT |x| |n|)) - -(PUT (QUOTE |INT;odd?;$B;41|) (QUOTE |SPADreplace|) (QUOTE ODDP)) - -(DEFUN |INT;odd?;$B;41| (|x| |$|) (ODDP |x|)) - -(PUT (QUOTE |INT;max;3$;42|) (QUOTE |SPADreplace|) (QUOTE MAX)) - -(DEFUN |INT;max;3$;42| (|x| |y| |$|) (MAX |x| |y|)) - -(PUT (QUOTE |INT;min;3$;43|) (QUOTE |SPADreplace|) (QUOTE MIN)) - -(DEFUN |INT;min;3$;43| (|x| |y| |$|) (MIN |x| |y|)) - -(PUT (QUOTE |INT;divide;2$R;44|) (QUOTE |SPADreplace|) (QUOTE DIVIDE2)) - -(DEFUN |INT;divide;2$R;44| (|x| |y| |$|) (DIVIDE2 |x| |y|)) - -(PUT (QUOTE |INT;quo;3$;45|) (QUOTE |SPADreplace|) (QUOTE QUOTIENT2)) - -(DEFUN |INT;quo;3$;45| (|x| |y| |$|) (QUOTIENT2 |x| |y|)) - -(PUT (QUOTE |INT;rem;3$;46|) (QUOTE |SPADreplace|) (QUOTE REMAINDER2)) - -(DEFUN |INT;rem;3$;46| (|x| |y| |$|) (REMAINDER2 |x| |y|)) - -(PUT (QUOTE |INT;shift;3$;47|) (QUOTE |SPADreplace|) (QUOTE ASH)) - -(DEFUN |INT;shift;3$;47| (|x| |y| |$|) (ASH |x| |y|)) - -(DEFUN |INT;exquo;2$U;48| (|x| |y| |$|) (COND ((OR (ZEROP |y|) (NULL (ZEROP (REMAINDER2 |x| |y|)))) (CONS 1 "failed")) ((QUOTE T) (CONS 0 (QUOTIENT2 |x| |y|))))) - -(DEFUN |INT;recip;$U;49| (|x| |$|) (COND ((OR (EQL |x| 1) (EQL |x| -1)) (CONS 0 |x|)) ((QUOTE T) (CONS 1 "failed")))) - -(PUT (QUOTE |INT;gcd;3$;50|) (QUOTE |SPADreplace|) (QUOTE GCD)) - -(DEFUN |INT;gcd;3$;50| (|x| |y| |$|) (GCD |x| |y|)) - -(DEFUN |INT;unitNormal;$R;51| (|x| |$|) (COND ((|<| |x| 0) (VECTOR -1 (|-| |x|) -1)) ((QUOTE T) (VECTOR 1 |x| 1)))) - -(PUT (QUOTE |INT;unitCanonical;2$;52|) (QUOTE |SPADreplace|) (QUOTE ABS)) - -(DEFUN |INT;unitCanonical;2$;52| (|x| |$|) (ABS |x|)) - -(DEFUN |INT;solveLinearPolynomialEquation| (|lp| |p| |$|) (SPADCALL |lp| |p| (QREFELT |$| 91))) - -(DEFUN |INT;squareFreePolynomial| (|p| |$|) (SPADCALL |p| (QREFELT |$| 95))) - -(DEFUN |INT;factorPolynomial| (|p| |$|) (PROG (|pp| #1=#:G86409) (RETURN (SEQ (LETT |pp| (SPADCALL |p| (QREFELT |$| 96)) |INT;factorPolynomial|) (EXIT (COND ((EQL (SPADCALL |pp| (QREFELT |$| 97)) (SPADCALL |p| (QREFELT |$| 97))) (SPADCALL |p| (QREFELT |$| 99))) ((QUOTE T) (SPADCALL (SPADCALL |pp| (QREFELT |$| 99)) (SPADCALL (CONS (FUNCTION |INT;factorPolynomial!0|) |$|) (SPADCALL (PROG2 (LETT #1# (SPADCALL (SPADCALL |p| (QREFELT |$| 97)) (SPADCALL |pp| (QREFELT |$| 97)) (QREFELT |$| 81)) |INT;factorPolynomial|) (QCDR #1#) (|check-union| (QEQCAR #1# 0) |$| #1#)) (QREFELT |$| 102)) (QREFELT |$| 106)) (QREFELT |$| 108))))))))) - -(DEFUN |INT;factorPolynomial!0| (|#1| |$|) (SPADCALL |#1| (QREFELT |$| 100))) - -(DEFUN |INT;factorSquareFreePolynomial| (|p| |$|) (SPADCALL |p| (QREFELT |$| 109))) - -(DEFUN |INT;gcdPolynomial;3Sup;57| (|p| |q| |$|) (COND ((SPADCALL |p| (QREFELT |$| 110)) (SPADCALL |q| (QREFELT |$| 111))) ((SPADCALL |q| (QREFELT |$| 110)) (SPADCALL |p| (QREFELT |$| 111))) ((QUOTE T) (SPADCALL (LIST |p| |q|) (QREFELT |$| 114))))) - -(DEFUN |Integer| NIL (PROG NIL (RETURN (PROG (#1=#:G86434) (RETURN (COND ((LETT #1# (HGET |$ConstructorCache| (QUOTE |Integer|)) |Integer|) (|CDRwithIncrement| (CDAR #1#))) ((QUOTE T) (|UNWIND-PROTECT| (PROG1 (CDDAR (HPUT |$ConstructorCache| (QUOTE |Integer|) (LIST (CONS NIL (CONS 1 (|Integer;|)))))) (LETT #1# T |Integer|)) (COND ((NOT #1#) (HREM |$ConstructorCache| (QUOTE |Integer|)))))))))))) - -(DEFUN |Integer;| NIL (PROG (|dv$| |$| |pv$|) (RETURN (PROGN (LETT |dv$| (QUOTE (|Integer|)) . #1=(|Integer|)) (LETT |$| (GETREFV 130) . #1#) (QSETREFV |$| 0 |dv$|) (QSETREFV |$| 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#)) (|haddProp| |$ConstructorCache| (QUOTE |Integer|) NIL (CONS 1 |$|)) (|stuffDomainSlots| |$|) (QSETREFV |$| 69 (QSETREFV |$| 68 (CONS (|dispatchFunction| |INT;*;3$;39|) |$|))) |$|)))) - -(MAKEPROP (QUOTE |Integer|) (QUOTE |infovec|) (LIST (QUOTE #(NIL NIL NIL NIL NIL NIL (|Void|) (|OpenMathDevice|) (0 . |OMputApp|) (|String|) (5 . |OMputSymbol|) (|Integer|) (12 . |OMputInteger|) (18 . |OMputEndApp|) (|OpenMathEncoding|) (23 . |OMencodingXML|) (27 . |OMopenString|) (33 . |OMputObject|) (38 . |OMputEndObject|) (43 . |OMclose|) |INT;OMwrite;$S;2| (|Boolean|) |INT;OMwrite;$BS;3| |INT;OMwrite;Omd$V;4| |INT;OMwrite;Omd$BV;5| |INT;zero?;$B;6| (CONS IDENTITY (FUNCALL (|dispatchFunction| |INT;Zero;$;7|) |$|)) (CONS IDENTITY (FUNCALL (|dispatchFunction| |INT;One;$;8|) |$|)) |INT;base;$;9| |INT;copy;2$;10| |INT;inc;2$;11| |INT;dec;2$;12| |INT;hash;2$;13| |INT;negative?;$B;14| (|OutputForm|) (48 . |outputForm|) |INT;coerce;$Of;15| |INT;coerce;2$;16| |INT;convert;2$;17| |INT;length;2$;18| |INT;addmod;4$;19| |INT;submod;4$;20| |INT;mulmod;4$;21| (|Float|) (53 . |coerce|) |INT;convert;$F;22| (|DoubleFloat|) |INT;convert;$Df;23| (|InputForm|) (58 . |convert|) |INT;convert;$If;24| |INT;convert;$S;25| |INT;latex;$S;26| |INT;positiveRemainder;3$;27| (|Matrix| 11) (|Matrix| |$|) |INT;reducedSystem;2M;28| (|Record| (|:| |mat| 54) (|:| |vec| (|Vector| 11))) (|Vector| |$|) |INT;reducedSystem;MVR;29| |INT;abs;2$;30| |INT;random;$;31| |INT;random;2$;32| |INT;=;2$B;33| |INT;<;2$B;34| |INT;-;2$;35| |INT;+;3$;36| |INT;-;3$;37| NIL NIL (|NonNegativeInteger|) |INT;**;$Nni$;40| |INT;odd?;$B;41| |INT;max;3$;42| |INT;min;3$;43| (|Record| (|:| |quotient| |$|) (|:| |remainder| |$|)) |INT;divide;2$R;44| |INT;quo;3$;45| |INT;rem;3$;46| |INT;shift;3$;47| (|Union| |$| (QUOTE "failed")) |INT;exquo;2$U;48| |INT;recip;$U;49| |INT;gcd;3$;50| (|Record| (|:| |unit| |$|) (|:| |canonical| |$|) (|:| |associate| |$|)) |INT;unitNormal;$R;51| |INT;unitCanonical;2$;52| (|Union| 88 (QUOTE "failed")) (|List| 89) (|SparseUnivariatePolynomial| 11) (|IntegerSolveLinearPolynomialEquation|) (63 . |solveLinearPolynomialEquation|) (|Factored| 93) (|SparseUnivariatePolynomial| |$$|) (|UnivariatePolynomialSquareFree| |$$| 93) (69 . |squareFree|) (74 . |primitivePart|) (79 . |leadingCoefficient|) (|GaloisGroupFactorizer| 93) (84 . |factor|) (89 . |coerce|) (|Factored| |$|) (94 . |factor|) (|Mapping| 93 |$$|) (|Factored| |$$|) (|FactoredFunctions2| |$$| 93) (99 . |map|) (|FactoredFunctionUtilities| 93) (105 . |mergeFactors|) (111 . |factorSquareFree|) (116 . |zero?|) (121 . |unitCanonical|) (|List| 93) (|HeuGcd| 93) (126 . |gcd|) (|SparseUnivariatePolynomial| |$|) |INT;gcdPolynomial;3Sup;57| (|Union| 118 (QUOTE "failed")) (|Fraction| 11) (|PatternMatchResult| 11 |$|) (|Pattern| 11) (|Union| 11 (QUOTE "failed")) (|Union| 123 (QUOTE "failed")) (|List| |$|) (|Record| (|:| |coef| 123) (|:| |generator| |$|)) (|Record| (|:| |coef1| |$|) (|:| |coef2| |$|)) (|Union| 125 (QUOTE "failed")) (|Record| (|:| |coef1| |$|) (|:| |coef2| |$|) (|:| |generator| |$|)) (|PositiveInteger|) (|SingleInteger|))) (QUOTE #(|~=| 131 |zero?| 137 |unitNormal| 142 |unitCanonical| 147 |unit?| 152 |symmetricRemainder| 157 |subtractIfCan| 163 |submod| 169 |squareFreePart| 176 |squareFree| 181 |sizeLess?| 186 |sign| 192 |shift| 197 |sample| 203 |retractIfCan| 207 |retract| 212 |rem| 217 |reducedSystem| 223 |recip| 234 |rationalIfCan| 239 |rational?| 244 |rational| 249 |random| 254 |quo| 263 |principalIdeal| 269 |prime?| 274 |powmod| 279 |positiveRemainder| 286 |positive?| 292 |permutation| 297 |patternMatch| 303 |one?| 310 |odd?| 315 |nextItem| 320 |negative?| 325 |multiEuclidean| 330 |mulmod| 336 |min| 343 |max| 349 |mask| 355 |length| 360 |lcm| 365 |latex| 376 |invmod| 381 |init| 387 |inc| 391 |hash| 396 |gcdPolynomial| 406 |gcd| 412 |factorial| 423 |factor| 428 |extendedEuclidean| 433 |exquo| 446 |expressIdealMember| 452 |even?| 458 |euclideanSize| 463 |divide| 468 |differentiate| 474 |dec| 485 |copy| 490 |convert| 495 |coerce| 525 |characteristic| 545 |bit?| 549 |binomial| 555 |base| 561 |associates?| 565 |addmod| 571 |abs| 578 |^| 583 |Zero| 595 |One| 599 |OMwrite| 603 D 627 |>=| 638 |>| 644 |=| 650 |<=| 656 |<| 662 |-| 668 |+| 679 |**| 685 |*| 697)) (QUOTE ((|infinite| . 0) (|noetherian| . 0) (|canonicalsClosed| . 0) (|canonical| . 0) (|canonicalUnitNormal| . 0) (|multiplicativeValuation| . 0) (|noZeroDivisors| . 0) ((|commutative| "*") . 0) (|rightUnitary| . 0) (|leftUnitary| . 0) (|unitsKnown| . 0))) (CONS (|makeByteWordVec2| 1 (QUOTE (0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0))) (CONS (QUOTE #(|IntegerNumberSystem&| |EuclideanDomain&| |UniqueFactorizationDomain&| NIL NIL |GcdDomain&| |IntegralDomain&| |Algebra&| NIL NIL |DifferentialRing&| |OrderedRing&| NIL NIL |Module&| NIL NIL |Ring&| NIL NIL NIL NIL NIL |AbelianGroup&| NIL NIL |AbelianMonoid&| |Monoid&| NIL NIL |OrderedSet&| |AbelianSemiGroup&| |SemiGroup&| NIL |SetCategory&| NIL NIL NIL NIL NIL NIL NIL |RetractableTo&| NIL |BasicType&| NIL)) (CONS (QUOTE #((|IntegerNumberSystem|) (|EuclideanDomain|) (|UniqueFactorizationDomain|) (|PrincipalIdealDomain|) (|OrderedIntegralDomain|) (|GcdDomain|) (|IntegralDomain|) (|Algebra| |$$|) (|CharacteristicZero|) (|LinearlyExplicitRingOver| 11) (|DifferentialRing|) (|OrderedRing|) (|CommutativeRing|) (|EntireRing|) (|Module| |$$|) (|OrderedAbelianGroup|) (|BiModule| |$$| |$$|) (|Ring|) (|OrderedCancellationAbelianMonoid|) (|LeftModule| |$$|) (|Rng|) (|RightModule| |$$|) (|OrderedAbelianMonoid|) (|AbelianGroup|) (|OrderedAbelianSemiGroup|) (|CancellationAbelianMonoid|) (|AbelianMonoid|) (|Monoid|) (|StepThrough|) (|PatternMatchable| 11) (|OrderedSet|) (|AbelianSemiGroup|) (|SemiGroup|) (|RealConstant|) (|SetCategory|) (|OpenMath|) (|ConvertibleTo| 9) (|ConvertibleTo| 43) (|ConvertibleTo| 46) (|CombinatorialFunctionCategory|) (|ConvertibleTo| 120) (|ConvertibleTo| 48) (|RetractableTo| 11) (|ConvertibleTo| 11) (|BasicType|) (|CoercibleTo| 34))) (|makeByteWordVec2| 129 (QUOTE (1 7 6 0 8 3 7 6 0 9 9 10 2 7 6 0 11 12 1 7 6 0 13 0 14 0 15 2 7 0 9 14 16 1 7 6 0 17 1 7 6 0 18 1 7 6 0 19 1 34 0 11 35 1 43 0 11 44 1 48 0 11 49 2 90 87 88 89 91 1 94 92 93 95 1 93 0 0 96 1 93 2 0 97 1 98 92 93 99 1 93 0 2 100 1 0 101 0 102 2 105 92 103 104 106 2 107 92 92 92 108 1 98 92 93 109 1 93 21 0 110 1 93 0 0 111 1 113 93 112 114 2 0 21 0 0 1 1 0 21 0 25 1 0 84 0 85 1 0 0 0 86 1 0 21 0 1 2 0 0 0 0 1 2 0 80 0 0 1 3 0 0 0 0 0 41 1 0 0 0 1 1 0 101 0 1 2 0 21 0 0 1 1 0 11 0 1 2 0 0 0 0 79 0 0 0 1 1 0 121 0 1 1 0 11 0 1 2 0 0 0 0 78 2 0 57 55 58 59 1 0 54 55 56 1 0 80 0 82 1 0 117 0 1 1 0 21 0 1 1 0 118 0 1 1 0 0 0 62 0 0 0 61 2 0 0 0 0 77 1 0 124 123 1 1 0 21 0 1 3 0 0 0 0 0 1 2 0 0 0 0 53 1 0 21 0 1 2 0 0 0 0 1 3 0 119 0 120 119 1 1 0 21 0 1 1 0 21 0 72 1 0 80 0 1 1 0 21 0 33 2 0 122 123 0 1 3 0 0 0 0 0 42 2 0 0 0 0 74 2 0 0 0 0 73 1 0 0 0 1 1 0 0 0 39 1 0 0 123 1 2 0 0 0 0 1 1 0 9 0 52 2 0 0 0 0 1 0 0 0 1 1 0 0 0 30 1 0 0 0 32 1 0 129 0 1 2 0 115 115 115 116 2 0 0 0 0 83 1 0 0 123 1 1 0 0 0 1 1 0 101 0 102 3 0 126 0 0 0 1 2 0 127 0 0 1 2 0 80 0 0 81 2 0 122 123 0 1 1 0 21 0 1 1 0 70 0 1 2 0 75 0 0 76 1 0 0 0 1 2 0 0 0 70 1 1 0 0 0 31 1 0 0 0 29 1 0 9 0 51 1 0 46 0 47 1 0 43 0 45 1 0 48 0 50 1 0 120 0 1 1 0 11 0 38 1 0 0 11 37 1 0 0 11 37 1 0 0 0 1 1 0 34 0 36 0 0 70 1 2 0 21 0 0 1 2 0 0 0 0 1 0 0 0 28 2 0 21 0 0 1 3 0 0 0 0 0 40 1 0 0 0 60 2 0 0 0 70 1 2 0 0 0 128 1 0 0 0 26 0 0 0 27 3 0 6 7 0 21 24 2 0 9 0 21 22 2 0 6 7 0 23 1 0 9 0 20 1 0 0 0 1 2 0 0 0 70 1 2 0 21 0 0 1 2 0 21 0 0 1 2 0 21 0 0 63 2 0 21 0 0 1 2 0 21 0 0 64 2 0 0 0 0 67 1 0 0 0 65 2 0 0 0 0 66 2 0 0 0 70 71 2 0 0 0 128 1 2 0 0 0 0 68 2 0 0 11 0 69 2 0 0 70 0 1 2 0 0 128 0 1)))))) (QUOTE |lookupComplete|))) - -(MAKEPROP (QUOTE |Integer|) (QUOTE NILADIC) T) -@ -\section{domain NNI NonNegativeInteger} -<>= -)abbrev domain NNI NonNegativeInteger -++ Author: -++ Date Created: -++ Change History: -++ Basic Operations: -++ Related Constructors: -++ Keywords: integer -++ Description: \spadtype{NonNegativeInteger} provides functions for non -++ negative integers. -NonNegativeInteger: Join(OrderedAbelianMonoidSup,Monoid) with - _quo : (%,%) -> % - ++ a quo b returns the quotient of \spad{a} and b, forgetting - ++ the remainder. - _rem : (%,%) -> % - ++ a rem b returns the remainder of \spad{a} and b. - gcd : (%,%) -> % - ++ gcd(a,b) computes the greatest common divisor of two - ++ non negative integers \spad{a} and b. - divide: (%,%) -> Record(quotient:%,remainder:%) - ++ divide(a,b) returns a record containing both - ++ remainder and quotient. - _exquo: (%,%) -> Union(%,"failed") - ++ exquo(a,b) returns the quotient of \spad{a} and b, or "failed" - ++ if b is zero or \spad{a} rem b is zero. - shift: (%, Integer) -> % - ++ shift(a,i) shift \spad{a} by i bits. - random : % -> % - ++ random(n) returns a random integer from 0 to \spad{n-1}. - commutative("*") - ++ commutative("*") means multiplication is commutative : \spad{x*y = y*x}. - - == SubDomain(Integer,#1 >= 0) add - x,y:% - sup(x,y) == MAX(x,y)$Lisp - shift(x:%, n:Integer):% == ASH(x,n)$Lisp - subtractIfCan(x, y) == - c:Integer := (x pretend Integer) - (y pretend Integer) - c < 0 => "failed" - c pretend % - -@ -\section{NNI.lsp BOOTSTRAP} -{\bf NNI} depends on itself. We need to break this cycle to build -the algebra. So we keep a cached copy of the translated {\bf NNI} -category which we can write into the {\bf MID} directory. We compile -the lisp code and copy the {\bf NNI.o} file to the {\bf OUT} directory. -This is eventually forcibly replaced by a recompiled version. - -Note that this code is not included in the generated catdef.spad file. - -<>= - -(|/VERSIONCHECK| 2) - -(SETQ |$CategoryFrame| - (|put| - #1=(QUOTE |NonNegativeInteger|) - (QUOTE |SuperDomain|) - #2=(QUOTE (|Integer|)) - (|put| - #2# - #3=(QUOTE |SubDomain|) - (CONS - (QUOTE - (|NonNegativeInteger| - COND ((|<| |#1| 0) (QUOTE NIL)) ((QUOTE T) (QUOTE T)))) - (DELASC #1# (|get| #2# #3# |$CategoryFrame|))) - |$CategoryFrame|))) - -(PUT - (QUOTE |NNI;sup;3$;1|) - (QUOTE |SPADreplace|) - (QUOTE MAX)) - -(DEFUN |NNI;sup;3$;1| (|x| |y| |$|) (MAX |x| |y|)) - -(PUT - (QUOTE |NNI;shift;$I$;2|) - (QUOTE |SPADreplace|) - (QUOTE ASH)) - -(DEFUN |NNI;shift;$I$;2| (|x| |n| |$|) (ASH |x| |n|)) - -(DEFUN |NNI;subtractIfCan;2$U;3| (|x| |y| |$|) - (PROG (|c|) - (RETURN - (SEQ - (LETT |c| (|-| |x| |y|) |NNI;subtractIfCan;2$U;3|) - (EXIT - (COND - ((|<| |c| 0) (CONS 1 "failed")) - ((QUOTE T) (CONS 0 |c|)))))))) - -(DEFUN |NonNegativeInteger| NIL - (PROG NIL - (RETURN - (PROG (#1=#:G96708) - (RETURN - (COND - ((LETT #1# - (HGET |$ConstructorCache| (QUOTE |NonNegativeInteger|)) - |NonNegativeInteger|) - (|CDRwithIncrement| (CDAR #1#))) - ((QUOTE T) - (|UNWIND-PROTECT| - (PROG1 - (CDDAR - (HPUT - |$ConstructorCache| - (QUOTE |NonNegativeInteger|) - (LIST (CONS NIL (CONS 1 (|NonNegativeInteger;|)))))) - (LETT #1# T |NonNegativeInteger|)) - (COND - ((NOT #1#) - (HREM - |$ConstructorCache| - (QUOTE |NonNegativeInteger|)))))))))))) - -(DEFUN |NonNegativeInteger;| NIL - (PROG (|dv$| |$| |pv$|) - (RETURN - (PROGN - (LETT |dv$| (QUOTE (|NonNegativeInteger|)) . #1=(|NonNegativeInteger|)) - (LETT |$| (GETREFV 17) . #1#) - (QSETREFV |$| 0 |dv$|) - (QSETREFV |$| 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#)) - (|haddProp| - |$ConstructorCache| - (QUOTE |NonNegativeInteger|) - NIL - (CONS 1 |$|)) - (|stuffDomainSlots| |$|) |$|)))) - -(MAKEPROP - (QUOTE |NonNegativeInteger|) - (QUOTE |infovec|) - (LIST - (QUOTE - #(NIL NIL NIL NIL NIL - (|Integer|) - |NNI;sup;3$;1| - |NNI;shift;$I$;2| - (|Union| |$| (QUOTE "failed")) - |NNI;subtractIfCan;2$U;3| - (|Record| (|:| |quotient| |$|) (|:| |remainder| |$|)) - (|PositiveInteger|) - (|Boolean|) - (|NonNegativeInteger|) - (|SingleInteger|) - (|String|) - (|OutputForm|))) - (QUOTE - #(|~=| 0 |zero?| 6 |sup| 11 |subtractIfCan| 17 |shift| 23 |sample| 29 - |rem| 33 |recip| 39 |random| 44 |quo| 49 |one?| 55 |min| 60 |max| 66 - |latex| 72 |hash| 77 |gcd| 82 |exquo| 88 |divide| 94 |coerce| 100 - |^| 105 |Zero| 117 |One| 121 |>=| 125 |>| 131 |=| 137 |<=| 143 - |<| 149 |+| 155 |**| 161 |*| 173)) - (QUOTE (((|commutative| "*") . 0))) - (CONS - (|makeByteWordVec2| 1 (QUOTE (0 0 0 0 0 0 0 0 0 0 0 0 0))) - (CONS - (QUOTE - #(NIL NIL NIL NIL NIL - |Monoid&| - |AbelianMonoid&| - |OrderedSet&| - |SemiGroup&| - |AbelianSemiGroup&| - |SetCategory&| - |BasicType&| - NIL)) - (CONS - (QUOTE - #((|OrderedAbelianMonoidSup|) - (|OrderedCancellationAbelianMonoid|) - (|OrderedAbelianMonoid|) - (|OrderedAbelianSemiGroup|) - (|CancellationAbelianMonoid|) - (|Monoid|) - (|AbelianMonoid|) - (|OrderedSet|) - (|SemiGroup|) - (|AbelianSemiGroup|) - (|SetCategory|) - (|BasicType|) - (|CoercibleTo| 16))) - (|makeByteWordVec2| 16 - (QUOTE - (2 0 12 0 0 1 1 0 12 0 1 2 0 0 0 0 6 2 0 8 0 0 9 2 0 0 0 5 7 0 0 - 0 1 2 0 0 0 0 1 1 0 8 0 1 1 0 0 0 1 2 0 0 0 0 1 1 0 12 0 1 2 0 - 0 0 0 1 2 0 0 0 0 1 1 0 15 0 1 1 0 14 0 1 2 0 0 0 0 1 2 0 8 0 0 - 1 2 0 10 0 0 1 1 0 16 0 1 2 0 0 0 11 1 2 0 0 0 13 1 0 0 0 1 0 0 - 0 1 2 0 12 0 0 1 2 0 12 0 0 1 2 0 12 0 0 1 2 0 12 0 0 1 2 0 12 - 0 0 1 2 0 0 0 0 1 2 0 0 0 11 1 2 0 0 0 13 1 2 0 0 0 0 1 2 0 0 - 11 0 1 2 0 0 13 0 1)))))) - (QUOTE |lookupComplete|))) - -(MAKEPROP (QUOTE |NonNegativeInteger|) (QUOTE NILADIC) T) - -@ -\section{domain PI PositiveInteger} -<>= -)abbrev domain PI PositiveInteger -++ Author: -++ Date Created: -++ Change History: -++ Basic Operations: -++ Related Constructors: -++ Keywords: positive integer -++ Description: \spadtype{PositiveInteger} provides functions for -++ positive integers. -PositiveInteger: Join(AbelianSemiGroup,OrderedSet,Monoid) with - gcd: (%,%) -> % - ++ gcd(a,b) computes the greatest common divisor of two - ++ positive integers \spad{a} and b. - commutative("*") - ++ commutative("*") means multiplication is commutative : x*y = y*x - == SubDomain(NonNegativeInteger,#1 > 0) add - x:% - y:% - -@ -\section{PI.lsp BOOTSTRAP} -{\bf PI} depends on itself. We need to break this cycle to build -the algebra. So we keep a cached copy of the translated {\bf PI} -category which we can write into the {\bf MID} directory. We compile -the lisp code and copy the {\bf PI.o} file to the {\bf OUT} directory. -This is eventually forcibly replaced by a recompiled version. - -Note that this code is not included in the generated catdef.spad file. - -<>= - -(|/VERSIONCHECK| 2) - -(SETQ |$CategoryFrame| - (|put| - #1=(QUOTE |PositiveInteger|) - (QUOTE |SuperDomain|) - #2=(QUOTE (|NonNegativeInteger|)) - (|put| - #2# - #3=(QUOTE |SubDomain|) - (CONS - (QUOTE (|PositiveInteger| |<| 0 |#1|)) - (DELASC #1# (|get| #2# #3# |$CategoryFrame|))) - |$CategoryFrame|))) - -(DEFUN |PositiveInteger| NIL - (PROG NIL - (RETURN - (PROG (#1=#:G96739) - (RETURN - (COND - ((LETT #1# - (HGET |$ConstructorCache| (QUOTE |PositiveInteger|)) - |PositiveInteger|) - (|CDRwithIncrement| (CDAR #1#))) - ((QUOTE T) - (|UNWIND-PROTECT| - (PROG1 - (CDDAR (HPUT |$ConstructorCache| (QUOTE |PositiveInteger|) (LIST (CONS NIL (CONS 1 (|PositiveInteger;|)))))) - (LETT #1# T |PositiveInteger|)) - (COND - ((NOT #1#) - (HREM - |$ConstructorCache| - (QUOTE |PositiveInteger|)))))))))))) - -(DEFUN |PositiveInteger;| NIL - (PROG (|dv$| |$| |pv$|) - (RETURN - (PROGN - (LETT |dv$| (QUOTE (|PositiveInteger|)) . #1=(|PositiveInteger|)) - (LETT |$| (GETREFV 12) . #1#) - (QSETREFV |$| 0 |dv$|) - (QSETREFV |$| 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#)) - (|haddProp| - |$ConstructorCache| (QUOTE |PositiveInteger|) NIL (CONS 1 |$|)) - (|stuffDomainSlots| |$|) - |$|)))) - -(MAKEPROP - (QUOTE |PositiveInteger|) - (QUOTE |infovec|) - (LIST - (QUOTE - #(NIL NIL NIL NIL NIL - (|NonNegativeInteger|) - (|PositiveInteger|) - (|Boolean|) - (|Union| |$| (QUOTE "failed")) - (|SingleInteger|) - (|String|) - (|OutputForm|))) - (QUOTE #(|~=| 0 |sample| 6 |recip| 10 |one?| 15 |min| 20 |max| 26 - |latex| 32 |hash| 37 |gcd| 42 |coerce| 48 |^| 53 |One| 65 - |>=| 69 |>| 75 |=| 81 |<=| 87 |<| 93 |+| 99 |**| 105 |*| 117)) - (QUOTE (((|commutative| "*") . 0))) - (CONS - (|makeByteWordVec2| 1 (QUOTE (0 0 0 0 0 0 0))) - (CONS - (QUOTE #(|Monoid&| |AbelianSemiGroup&| |SemiGroup&| |OrderedSet&| - |SetCategory&| |BasicType&| NIL)) - (CONS - (QUOTE #( - (|Monoid|) - (|AbelianSemiGroup|) - (|SemiGroup|) - (|OrderedSet|) - (|SetCategory|) - (|BasicType|) - (|CoercibleTo| 11))) - (|makeByteWordVec2| 11 - (QUOTE (2 0 7 0 0 1 0 0 0 1 1 0 8 0 1 1 0 7 0 1 2 0 0 0 0 1 2 0 0 0 - 0 1 1 0 10 0 1 1 0 9 0 1 2 0 0 0 0 1 1 0 11 0 1 2 0 0 0 6 1 - 2 0 0 0 5 1 0 0 0 1 2 0 7 0 0 1 2 0 7 0 0 1 2 0 7 0 0 1 2 0 - 7 0 0 1 2 0 7 0 0 1 2 0 0 0 0 1 2 0 0 0 6 1 2 0 0 0 5 1 2 0 - 0 0 0 1 2 0 0 6 0 1)))))) - (QUOTE |lookupComplete|))) - -(MAKEPROP (QUOTE |PositiveInteger|) (QUOTE NILADIC) T) - -@ -\section{domain ROMAN RomanNumeral} -<>= --- integer.spad.pamphlet RomanNumeral.input -)spool RomanNumeral.output -)set message test on -)set message auto off -)clear all ---S 1 of 15 -f := operator 'f ---R ---R ---R (1) f ---R Type: BasicOperator ---E 1 - ---S 2 of 15 -D(f x,x,7) ---R ---R ---R (vii) ---R (2) f (x) ---R ---R Type: Expression Integer ---E 2 - ---S 3 of 15 -a := roman(1978 - 1965) ---R ---R ---R (3) XIII ---R Type: RomanNumeral ---E 3 - ---S 4 of 15 -x : UTS(ROMAN,'x,0) := x ---R ---R ---R (4) x ---R Type: UnivariateTaylorSeries(RomanNumeral,x,0) ---E 4 - ---S 5 of 15 -recip(1 - x - x**2) ---R ---R ---R (5) ---R 2 3 4 5 6 7 8 ---R I + x + II x + III x + V x + VIII x + XIII x + XXI x + XXXIV x ---R + ---R 9 10 11 ---R LV x + LXXXIX x + O(x ) ---R Type: Union(UnivariateTaylorSeries(RomanNumeral,x,0),...) ---E 5 - ---S 6 of 15 -m : MATRIX FRAC ROMAN ---R ---R Type: Void ---E 6 - ---S 7 of 15 -m := matrix [ [1/(i + j) for i in 1..3] for j in 1..3] ---R ---R ---R + I I I+ ---R |-- --- --| ---R |II III IV| ---R | | ---R | I I I | ---R (7) |--- -- - | ---R |III IV V | ---R | | ---R | I I I| ---R |-- - --| ---R +IV V VI+ ---R Type: Matrix Fraction RomanNumeral ---E 7 - ---S 8 of 15 -inverse m ---R ---R ---R +LXXII - CCXL CLXXX + ---R | | ---R (8) |- CCXL CM - DCCXX| ---R | | ---R +CLXXX - DCCXX DC + ---R Type: Union(Matrix Fraction RomanNumeral,...) ---E 8 - ---S 9 of 15 -y := factorial 10 ---R ---R ---R (9) 3628800 ---R Type: PositiveInteger ---E 9 - ---S 10 of 15 -roman y ---R ---R ---R (10) ---R ((((I))))((((I))))((((I)))) (((I)))(((I)))(((I)))(((I)))(((I)))(((I))) ((I))( ---R (I)) MMMMMMMMDCCC ---R Type: RomanNumeral ---E 10 - ---S 11 of 15 -a := roman(78) ---R ---R ---R (11) LXXVIII ---R Type: RomanNumeral ---E 11 - ---S 12 of 15 -b := roman(87) ---R ---R ---R (12) LXXXVII ---R Type: RomanNumeral ---E 12 - ---S 13 of 15 -a + b ---R ---R ---R (13) CLXV ---R Type: RomanNumeral ---E 13 - ---S 14 of 15 -a * b ---R ---R ---R (14) MMMMMMDCCLXXXVI ---R Type: RomanNumeral ---E 14 - ---S 15 of 15 -b rem a ---R ---R ---R (15) IX ---R Type: RomanNumeral ---E 15 -)spool -)lisp (bye) -@ -<>= -==================================================================== -RomanNumeral Examples -==================================================================== - -The Roman numeral package was added to Axiom in MCMLXXXVI for use in -denoting higher order derivatives. - -For example, let f be a symbolic operator. - - f := operator 'f - f - Type: BasicOperator - -This is the seventh derivative of f with respect to x. - D(f x,x,7) - (vii) - f (x) - Type: Expression Integer - -You can have integers printed as Roman numerals by declaring variables to -be of type RomanNumeral (abbreviation ROMAN). - - a := roman(1978 - 1965) - XIII - Type: RomanNumeral - -This package now has a small but devoted group of followers that claim -this domain has shown its efficacy in many other contexts. They claim -that Roman numerals are every bit as useful as ordinary integers. - -In a sense, they are correct, because Roman numerals form a ring and you -can therefore construct polynomials with Roman numeral coefficients, -matrices over Roman numerals, etc.. - - x : UTS(ROMAN,'x,0) := x - x - Type: UnivariateTaylorSeries(RomanNumeral,x,0) - -Was Fibonacci Italian or ROMAN? - - recip(1 - x - x**2) - 2 3 4 5 6 7 8 - I + x + II x + III x + V x + VIII x + XIII x + XXI x + XXXIV x - + - 9 10 11 - LV x + LXXXIX x + O(x ) - Type: Union(UnivariateTaylorSeries(RomanNumeral,x,0),...) - -You can also construct fractions with Roman numeral numerators and -denominators, as this matrix Hilberticus illustrates. - - m : MATRIX FRAC ROMAN - Type: Void - - m := matrix [ [1/(i + j) for i in 1..3] for j in 1..3] - + I I I+ - |-- --- --| - |II III IV| - | | - | I I I | - |--- -- - | - |III IV V | - | | - | I I I| - |-- - --| - +IV V VI+ - Type: Matrix Fraction RomanNumeral - -Note that the inverse of the matrix has integral ROMAN entries. - - inverse m - +LXXII - CCXL CLXXX + - | | - |- CCXL CM - DCCXX| - | | - +CLXXX - DCCXX DC + - Type: Union(Matrix Fraction RomanNumeral,...) - -Unfortunately, the spoil-sports say that the fun stops when the -numbers get big---mostly because the Romans didn't establish -conventions about representing very large numbers. - - y := factorial 10 - 3628800 - Type: PositiveInteger - -You work it out! - - roman y - ((((I))))((((I))))((((I)))) (((I)))(((I)))(((I)))(((I)))(((I)))(((I))) ((I))( - (I)) MMMMMMMMDCCC - Type: RomanNumeral - -Issue the system command )show RomanNumeral to display the full -list of operations defined by RomanNumeral. - - - a := roman(78) - LXXVIII - Type: RomanNumeral - - b := roman(87) - LXXXVII - Type: RomanNumeral - - a + b - CLXV - Type: RomanNumeral - - a * b - MMMMMMDCCLXXXVI - Type: RomanNumeral - - b rem a - IX - Type: RomanNumeral - -See Also: -o )help Integer -o )help Complex -o )help Factored -o )help Records -o )help Fraction -o )help RadixExpansion -o )help HexadecimalExpansion -o )help BinaryExpansion -o )help DecimalExpansion -o )help IntegerNumberTheoryFunctions -o )show RomanNumeral -o $AXIOM/doc/src/algebra/integer.spad.dvi - -@ -<>= -)abbrev domain ROMAN RomanNumeral -++ Author: -++ Date Created: -++ Change History: -++ Basic Operations: -++ convert, roman -++ Related Constructors: -++ Keywords: roman numerals -++ Description: \spadtype{RomanNumeral} provides functions for converting -++ integers to roman numerals. -RomanNumeral(): IntegerNumberSystem with - canonical - ++ mathematical equality is data structure equality. - canonicalsClosed - ++ two positives multiply to give positive. - noetherian - ++ ascending chain condition on ideals. - convert: Symbol -> % - ++ convert(n) creates a roman numeral for symbol n. - roman : Symbol -> % - ++ roman(n) creates a roman numeral for symbol n. - roman : Integer -> % - ++ roman(n) creates a roman numeral for n. - - == Integer add - import NumberFormats() - - roman(n:Integer) == n::% - roman(sy:Symbol) == convert sy - convert(sy:Symbol):% == ScanRoman(string sy)::% - - coerce(r:%):OutputForm == - n := convert(r)@Integer - -- okay, we stretch it - zero? n => n::OutputForm - negative? n => - ((-r)::OutputForm) - FormatRoman(n::PositiveInteger)::Symbol::OutputForm - -@ \section{License} <>= --Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. @@ -1796,10 +94,6 @@ RomanNumeral(): IntegerNumberSystem with <> <> -<> -<> -<> -<> @ \eject \begin{thebibliography}{99} diff --git a/src/algebra/interval.spad.pamphlet b/src/algebra/interval.spad.pamphlet deleted file mode 100644 index 9fb1c3b..0000000 --- a/src/algebra/interval.spad.pamphlet +++ /dev/null @@ -1,501 +0,0 @@ -\documentclass{article} -\usepackage{axiom} -\begin{document} -\title{\$SPAD/src/algebra interval.spad} -\author{Mike Dewar} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject -\section{domain INTRVL Interval} -<>= -)abbrev domain INTRVL Interval -+++ Author: Mike Dewar -+++ Date Created: November 1996 -+++ Date Last Updated: -+++ Basic Functions: -+++ Related Constructors: -+++ Also See: -+++ AMS Classifications: -+++ Keywords: -+++ References: -+++ Description: -+++ This domain is an implementation of interval arithmetic and transcendental -+++ functions over intervals. -Interval(R:Join(FloatingPointSystem,TranscendentalFunctionCategory)): IntervalCategory(R) == add - - import Integer --- import from R - - Rep := Record(Inf:R, Sup:R) - - roundDown(u:R):R == - if zero?(u) then float(-1,-(bits() pretend Integer)) - else float(mantissa(u) - 1,exponent(u)) - - roundUp(u:R):R == - if zero?(u) then float(1, -(bits()) pretend Integer) - else float(mantissa(u) + 1,exponent(u)) - - -- Sometimes the float representation does not use all the bits (e.g. when - -- representing an integer in software using arbitrary-length Integers as - -- your mantissa it is convenient to keep them exact). This function - -- normalises things so that rounding etc. works as expected. It is only - -- called when creating new intervals. - normaliseFloat(u:R):R == - zero? u => u - m : Integer := mantissa u - b : Integer := bits() pretend Integer - l : Integer := length(m) - if l < b then - BASE : Integer := base()$R pretend Integer - float(m*BASE**((b-l) pretend PositiveInteger),exponent(u)-b+l) - else - u - - interval(i:R,s:R):% == - i > s => [roundDown normaliseFloat s,roundUp normaliseFloat i] - [roundDown normaliseFloat i,roundUp normaliseFloat s] - - interval(f:R):% == - zero?(f) => 0 - one?(f) => 1 - -- This next part is necessary to allow e.g. mapping between Expressions: - -- AXIOM assumes that Integers stay as Integers! --- import from Union(value1:Integer,failed:"failed") - fnew : R := normaliseFloat f - retractIfCan(f)@Union(Integer,"failed") case "failed" => - [roundDown fnew, roundUp fnew] - [fnew,fnew] - - qinterval(i:R,s:R):% == - [roundDown normaliseFloat i,roundUp normaliseFloat s] - - exactInterval(i:R,s:R):% == [i,s] - exactSupInterval(i:R,s:R):% == [roundDown i,s] - exactInfInterval(i:R,s:R):% == [i,roundUp s] - - inf(u:%):R == u.Inf - sup(u:%):R == u.Sup - width(u:%):R == u.Sup - u.Inf - - contains?(u:%,f:R):Boolean == (f > inf(u)) and (f < sup(u)) - - positive?(u:%):Boolean == inf(u) > 0 - negative?(u:%):Boolean == sup(u) < 0 - - _< (a:%,b:%):Boolean == - if inf(a) < inf(b) then - true - else if inf(a) > inf(b) then - false - else - sup(a) < sup(b) - - _+ (a:%,b:%):% == - -- A couple of blatent hacks to preserve the Ring Axioms! - if zero?(a) then return(b) else if zero?(b) then return(a) - if a = b then return qinterval(2*inf(a),2*sup(a)) - qinterval(inf(a) + inf(b), sup(a) + sup(b)) - - - _- (a:%,b:%):% == - if zero?(a) then return(-b) else if zero?(b) then return(a) - if a = b then 0 else qinterval(inf(a) - sup(b), sup(a) - inf(b)) - - - _* (a:%,b:%):% == - -- A couple of blatent hacks to preserve the Ring Axioms! - if one?(a) then return(b) else if one?(b) then return(a) - if zero?(a) then return(0) else if zero?(b) then return(0) - prods : List R := sort [inf(a)*inf(b),sup(a)*sup(b), - inf(a)*sup(b),sup(a)*inf(b)] - qinterval(first prods, last prods) - - - _* (a:Integer,b:%):% == - if (a > 0) then - qinterval(a*inf(b),a*sup(b)) - else if (a < 0) then - qinterval(a*sup(b),a*inf(b)) - else - 0 - - _* (a:PositiveInteger,b:%):% == qinterval(a*inf(b),a*sup(b)) - - _*_* (a:%,n:PositiveInteger):% == - contains?(a,0) and zero?((n pretend Integer) rem 2) => - interval(0,max(inf(a)**n,sup(a)**n)) - interval(inf(a)**n,sup(a)**n) - - - _^ (a:%,n:PositiveInteger):% == - contains?(a,0) and zero?((n pretend Integer) rem 2) => - interval(0,max(inf(a)**n,sup(a)**n)) - interval(inf(a)**n,sup(a)**n) - - _- (a:%):% == exactInterval(-sup(a),-inf(a)) - - _= (a:%,b:%):Boolean == (inf(a)=inf(b)) and (sup(a)=sup(b)) - _~_= (a:%,b:%):Boolean == (inf(a)~=inf(b)) or (sup(a)~=sup(b)) - - 1 == - one : R := normaliseFloat 1 - [one,one] - - 0 == [0,0] - - recip(u:%):Union(%,"failed") == - contains?(u,0) => "failed" - vals:List R := sort [1/inf(u),1/sup(u)]$List(R) - qinterval(first vals, last vals) - - - unit?(u:%):Boolean == contains?(u,0) - - _exquo(u:%,v:%):Union(%,"failed") == - contains?(v,0) => "failed" - one?(v) => u - u=v => 1 - u=-v => -1 - vals:List R := sort [inf(u)/inf(v),inf(u)/sup(v),sup(u)/inf(v),sup(u)/sup(v)]$List(R) - qinterval(first vals, last vals) - - - gcd(u:%,v:%):% == 1 - - coerce(u:Integer):% == - ur := normaliseFloat(u::R) - exactInterval(ur,ur) - - - interval(u:Fraction Integer):% == --- import log2 : % -> % --- coerce : Integer -> % --- retractIfCan : % -> Union(value1:Integer,failed:"failed") --- from Float - flt := u::R - - -- Test if the representation in R is exact - --den := denom(u)::Float - bin : Union(Integer,"failed") := retractIfCan(log2(denom(u)::Float)) - bin case Integer and length(numer u)$Integer < (bits() pretend Integer) => - flt := normaliseFloat flt - exactInterval(flt,flt) - - qinterval(flt,flt) - - - retractIfCan(u:%):Union(Integer,"failed") == - not zero? width(u) => "failed" - retractIfCan inf u - - - retract(u:%):Integer == - not zero? width(u) => - error "attempt to retract a non-Integer interval to an Integer" - retract inf u - - - coerce(u:%):OutputForm == - bracket([coerce inf(u), coerce sup(u)]$List(OutputForm)) - - characteristic():NonNegativeInteger == 0 - - - -- Explicit export from TranscendentalFunctionCategory - pi():% == qinterval(pi(),pi()) - - -- From ElementaryFunctionCategory - log(u:%):% == - positive?(u) => qinterval(log inf u, log sup u) - error "negative logs in interval" - - - exp(u:%):% == qinterval(exp inf u, exp sup u) - - _*_* (u:%,v:%):% == - zero?(v) => if zero?(u) then error "0**0 is undefined" else 1 - one?(u) => 1 - expts : List R := sort [inf(u)**inf(v),sup(u)**sup(v), - inf(u)**sup(v),sup(u)**inf(v)] - qinterval(first expts, last expts) - - -- From TrigonometricFunctionCategory - - -- This function checks whether an interval contains a value of the form - -- `offset + 2 n pi'. - hasTwoPiMultiple(offset:R,ipi:R,i:%):Boolean == - next : Integer := retract ceiling( (inf(i) - offset)/(2*ipi) ) - contains?(i,offset+2*next*ipi) - - - -- This function checks whether an interval contains a value of the form - -- `offset + n pi'. - hasPiMultiple(offset:R,ipi:R,i:%):Boolean == - next : Integer := retract ceiling( (inf(i) - offset)/ipi ) - contains?(i,offset+next*ipi) - - - sin(u:%):% == - ipi : R := pi()$R - hasOne? : Boolean := hasTwoPiMultiple(ipi/(2::R),ipi,u) - hasMinusOne? : Boolean := hasTwoPiMultiple(3*ipi/(2::R),ipi,u) - - if hasOne? and hasMinusOne? then - exactInterval(-1,1) - else - vals : List R := sort [sin inf u, sin sup u] - if hasOne? then - exactSupInterval(first vals, 1) - else if hasMinusOne? then - exactInfInterval(-1,last vals) - else - qinterval(first vals, last vals) - - - - cos(u:%):% == - ipi : R := pi() - hasOne? : Boolean := hasTwoPiMultiple(0,ipi,u) - hasMinusOne? : Boolean := hasTwoPiMultiple(ipi,ipi,u) - - if hasOne? and hasMinusOne? then - exactInterval(-1,1) - else - vals : List R := sort [cos inf u, cos sup u] - if hasOne? then - exactSupInterval(first vals, 1) - else if hasMinusOne? then - exactInfInterval(-1,last vals) - else - qinterval(first vals, last vals) - - - - tan(u:%):% == - ipi : R := pi() - if width(u) > ipi then - error "Interval contains a singularity" - else - -- Since we know the interval is less than pi wide, monotonicity implies - -- that there is no singularity. If there is a singularity on a endpoint - -- of the interval the user will see the error generated by R. - lo : R := tan inf u - hi : R := tan sup u - - lo > hi => error "Interval contains a singularity" - qinterval(lo,hi) - - - - csc(u:%):% == - ipi : R := pi() - if width(u) > ipi then - error "Interval contains a singularity" - else --- import from Integer - -- singularities are at multiples of Pi - if hasPiMultiple(0,ipi,u) then error "Interval contains a singularity" - vals : List R := sort [csc inf u, csc sup u] - if hasTwoPiMultiple(ipi/(2::R),ipi,u) then - exactInfInterval(1,last vals) - else if hasTwoPiMultiple(3*ipi/(2::R),ipi,u) then - exactSupInterval(first vals,-1) - else - qinterval(first vals, last vals) - - - - sec(u:%):% == - ipi : R := pi() - if width(u) > ipi then - error "Interval contains a singularity" - else --- import from Integer - -- singularities are at Pi/2 + n Pi - if hasPiMultiple(ipi/(2::R),ipi,u) then - error "Interval contains a singularity" - vals : List R := sort [sec inf u, sec sup u] - if hasTwoPiMultiple(0,ipi,u) then - exactInfInterval(1,last vals) - else if hasTwoPiMultiple(ipi,ipi,u) then - exactSupInterval(first vals,-1) - else - qinterval(first vals, last vals) - - - - - cot(u:%):% == - ipi : R := pi() - if width(u) > ipi then - error "Interval contains a singularity" - else - -- Since we know the interval is less than pi wide, monotonicity implies - -- that there is no singularity. If there is a singularity on a endpoint - -- of the interval the user will see the error generated by R. - hi : R := cot inf u - lo : R := cot sup u - - lo > hi => error "Interval contains a singularity" - qinterval(lo,hi) - - - - -- From ArcTrigonometricFunctionCategory - - asin(u:%):% == - lo : R := inf(u) - hi : R := sup(u) - if (lo < -1) or (hi > 1) then error "asin only defined on the region -1..1" - qinterval(asin lo,asin hi) - - - acos(u:%):% == - lo : R := inf(u) - hi : R := sup(u) - if (lo < -1) or (hi > 1) then error "acos only defined on the region -1..1" - qinterval(acos hi,acos lo) - - - atan(u:%):% == qinterval(atan inf u, atan sup u) - - acot(u:%):% == qinterval(acot sup u, acot inf u) - - acsc(u:%):% == - lo : R := inf(u) - hi : R := sup(u) - if ((lo <= -1) and (hi >= -1)) or ((lo <= 1) and (hi >= 1)) then - error "acsc not defined on the region -1..1" - qinterval(acsc hi, acsc lo) - - - asec(u:%):% == - lo : R := inf(u) - hi : R := sup(u) - if ((lo < -1) and (hi > -1)) or ((lo < 1) and (hi > 1)) then - error "asec not defined on the region -1..1" - qinterval(asec lo, asec hi) - - - -- From HyperbolicFunctionCategory - - tanh(u:%):% == qinterval(tanh inf u, tanh sup u) - - sinh(u:%):% == qinterval(sinh inf u, sinh sup u) - - sech(u:%):% == - negative? u => qinterval(sech inf u, sech sup u) - positive? u => qinterval(sech sup u, sech inf u) - vals : List R := sort [sech inf u, sech sup u] - exactSupInterval(first vals,1) - - - cosh(u:%):% == - negative? u => qinterval(cosh sup u, cosh inf u) - positive? u => qinterval(cosh inf u, cosh sup u) - vals : List R := sort [cosh inf u, cosh sup u] - exactInfInterval(1,last vals) - - - csch(u:%):% == - contains?(u,0) => error "csch: singularity at zero" - qinterval(csch sup u, csch inf u) - - - coth(u:%):% == - contains?(u,0) => error "coth: singularity at zero" - qinterval(coth sup u, coth inf u) - - - -- From ArcHyperbolicFunctionCategory - - acosh(u:%):% == - inf(u)<1 => error "invalid argument: acosh only defined on the region 1.." - qinterval(acosh inf u, acosh sup u) - - - acoth(u:%):% == - lo : R := inf(u) - hi : R := sup(u) - if ((lo <= -1) and (hi >= -1)) or ((lo <= 1) and (hi >= 1)) then - error "acoth not defined on the region -1..1" - qinterval(acoth hi, acoth lo) - - - acsch(u:%):% == - contains?(u,0) => error "acsch: singularity at zero" - qinterval(acsch sup u, acsch inf u) - - - asech(u:%):% == - lo : R := inf(u) - hi : R := sup(u) - if (lo <= 0) or (hi > 1) then - error "asech only defined on the region 0 < x <= 1" - qinterval(asech hi, asech lo) - - - asinh(u:%):% == qinterval(asinh inf u, asinh sup u) - - atanh(u:%):% == - lo : R := inf(u) - hi : R := sup(u) - if (lo <= -1) or (hi >= 1) then - error "atanh only defined on the region -1 < x < 1" - qinterval(atanh lo, atanh hi) - - - -- From RadicalCategory - _*_* (u:%,n:Fraction Integer):% == interval(inf(u)**n,sup(u)**n) - -@ -\section{License} -<>= ---Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. ---All rights reserved. --- ---Redistribution and use in source and binary forms, with or without ---modification, are permitted provided that the following conditions are ---met: --- --- - Redistributions of source code must retain the above copyright --- notice, this list of conditions and the following disclaimer. --- --- - Redistributions in binary form must reproduce the above copyright --- notice, this list of conditions and the following disclaimer in --- the documentation and/or other materials provided with the --- distribution. --- --- - Neither the name of The Numerical ALgorithms Group Ltd. nor the --- names of its contributors may be used to endorse or promote products --- derived from this software without specific prior written permission. --- ---THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS ---IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ---TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A ---PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER ---OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ---EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ---PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ---PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ---LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ---NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ---SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -@ -<<*>>= -<> - -<> - -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document} - - diff --git a/src/algebra/ituple.spad.pamphlet b/src/algebra/ituple.spad.pamphlet index 84eaa8c..eb62d72 100644 --- a/src/algebra/ituple.spad.pamphlet +++ b/src/algebra/ituple.spad.pamphlet @@ -9,45 +9,6 @@ \eject \tableofcontents \eject -\section{domain ITUPLE InfiniteTuple} -<>= -)abbrev domain ITUPLE InfiniteTuple -++ Infinite tuples for the interpreter -++ Author: Clifton J. Williamson -++ Date Created: 16 February 1990 -++ Date Last Updated: 16 February 1990 -++ Keywords: -++ Examples: -++ References: -InfiniteTuple(S:Type): Exports == Implementation where - ++ This package implements 'infinite tuples' for the interpreter. - ++ The representation is a stream. - - Exports ==> CoercibleTo OutputForm with - map: (S -> S, %) -> % - ++ map(f,t) replaces the tuple t - ++ by \spad{[f(x) for x in t]}. - filterWhile: (S -> Boolean, %) -> % - ++ filterWhile(p,t) returns \spad{[x for x in t while p(x)]}. - filterUntil: (S -> Boolean, %) -> % - ++ filterUntil(p,t) returns \spad{[x for x in t while not p(x)]}. - select: (S -> Boolean, %) -> % - ++ select(p,t) returns \spad{[x for x in t | p(x)]}. - generate: (S -> S,S) -> % - ++ generate(f,s) returns \spad{[s,f(s),f(f(s)),...]}. - construct: % -> Stream S - ++ construct(t) converts an infinite tuple to a stream. - - Implementation ==> Stream S add - generate(f,x) == generate(f,x)$Stream(S) pretend % - filterWhile(f, x) == filterWhile(f,x pretend Stream(S))$Stream(S) pretend % - filterUntil(f, x) == filterUntil(f,x pretend Stream(S))$Stream(S) pretend % - select(f, x) == select(f,x pretend Stream(S))$Stream(S) pretend % - construct x == x pretend Stream(S) --- coerce x == --- coerce(x)$Stream(S) - -@ \section{package ITFUN2 InfiniteTupleFunctions2} <>= )abbrev package ITFUN2 InfiniteTupleFunctions2 @@ -129,7 +90,6 @@ InfiniteTupleFunctions3(A:Type, B:Type,C:Type): Exports <<*>>= <> -<> <> <> @ diff --git a/src/algebra/kl.spad.pamphlet b/src/algebra/kl.spad.pamphlet index 21c6869..1d37837 100644 --- a/src/algebra/kl.spad.pamphlet +++ b/src/algebra/kl.spad.pamphlet @@ -89,496 +89,6 @@ SortedCache(S:CachableSet): Exports == Implementation where x @ -\section{domain MKCHSET MakeCachableSet} -<>= -)abbrev domain MKCHSET MakeCachableSet -++ Make a cachable set from any set -++ Author: Manuel Bronstein -++ Date Created: ??? -++ Date Last Updated: 14 May 1991 -++ Description: -++ MakeCachableSet(S) returns a cachable set which is equal to S as a set. -MakeCachableSet(S:SetCategory): Exports == Implementation where - Exports ==> Join(CachableSet, CoercibleTo S) with - coerce: S -> % - ++ coerce(s) returns s viewed as an element of %. - - Implementation ==> add - import SortedCache(%) - - Rep := Record(setpart: S, pos: NonNegativeInteger) - - clearCache() - - position x == x.pos - setPosition(x, n) == (x.pos := n; void) - coerce(x:%):S == x.setpart - coerce(x:%):OutputForm == x::S::OutputForm - coerce(s:S):% == enterInCache([s, 0]$Rep, s = #1::S) - - x < y == - if position(x) = 0 then enterInCache(x, x::S = #1::S) - if position(y) = 0 then enterInCache(y, y::S = #1::S) - position(x) < position(y) - - x = y == - if position(x) = 0 then enterInCache(x, x::S = #1::S) - if position(y) = 0 then enterInCache(y, y::S = #1::S) - position(x) = position(y) - -@ -\section{domain KERNEL Kernel} -<>= --- kl.spad.pamphlet Kernel.input -)spool Kernel.output -)set message test on -)set message auto off -)clear all ---S 1 of 19 -x :: Expression Integer ---R ---R ---R (1) x ---R Type: Expression Integer ---E 1 - ---S 2 of 19 -kernel x ---R ---R ---R (2) x ---R Type: Kernel Expression Integer ---E 2 - ---S 3 of 19 -sin(x) + cos(x) ---R ---R ---R (3) sin(x) + cos(x) ---R Type: Expression Integer ---E 3 - ---S 4 of 19 -kernels % ---R ---R ---R (4) [sin(x),cos(x)] ---R Type: List Kernel Expression Integer ---E 4 - ---S 5 of 19 -sin(x)**2 + sin(x) + cos(x) ---R ---R ---R 2 ---R (5) sin(x) + sin(x) + cos(x) ---R Type: Expression Integer ---E 5 - ---S 6 of 19 -kernels % ---R ---R ---R (6) [sin(x),cos(x)] ---R Type: List Kernel Expression Integer ---E 6 - ---S 7 of 19 -kernels(1 :: Expression Integer) ---R ---R ---R (7) [] ---R Type: List Kernel Expression Integer ---E 7 - ---S 8 of 19 -mainKernel(cos(x) + tan(x)) ---R ---R ---R (8) tan(x) ---R Type: Union(Kernel Expression Integer,...) ---E 8 - ---S 9 of 19 -height kernel x ---R ---R ---R (9) 1 ---R Type: PositiveInteger ---E 9 - ---S 10 of 19 -height mainKernel(sin x) ---R ---R ---R (10) 2 ---R Type: PositiveInteger ---E 10 - ---S 11 of 19 -height mainKernel(sin cos x) ---R ---R ---R (11) 3 ---R Type: PositiveInteger ---E 11 - ---S 12 of 19 -height mainKernel(sin cos (tan x + sin x)) ---R ---R ---R (12) 4 ---R Type: PositiveInteger ---E 12 - ---S 13 of 19 -operator mainKernel(sin cos (tan x + sin x)) ---R ---R ---R (13) sin ---R Type: BasicOperator ---E 13 - ---S 14 of 19 -name mainKernel(sin cos (tan x + sin x)) ---R ---R ---R (14) sin ---R Type: Symbol ---E 14 - ---S 15 of 19 -f := operator 'f ---R ---R ---R (15) f ---R Type: BasicOperator ---E 15 - ---S 16 of 19 -e := f(x, y, 10) ---R ---R ---R (16) f(x,y,10) ---R Type: Expression Integer ---E 16 - ---S 17 of 19 -is?(e, f) ---R ---R ---R (17) true ---R Type: Boolean ---E 17 - ---S 18 of 19 -is?(e, 'f) ---R ---R ---R (18) true ---R Type: Boolean ---E 18 - ---S 19 of 19 -argument mainKernel e ---R ---R ---R (19) [x,y,10] ---R Type: List Expression Integer ---E 19 -)spool -)lisp (bye) -@ -<>= -==================================================================== -Kernel examples -==================================================================== - -A kernel is a symbolic function application (such as sin(x+ y)) -or a symbol (such as x). More precisely, a non-symbol -kernel over a set S is an operator applied to a given list of -arguments from S. The operator has type BasicOperator -and the kernel object is usually part of an Expression object. - -Kernels are created implicitly for you when you create expressions. - - x :: Expression Integer - x - Type: Expression Integer - -You can directly create a "symbol" kernel by using the kernel operation. - - kernel x - x - Type: Kernel Expression Integer - -This expression has two different kernels. - - sin(x) + cos(x) - sin(x) + cos(x) - Type: Expression Integer - -The operator kernels returns a list of the kernels in an object of -type Expression. - - kernels % - [sin(x),cos(x)] - Type: List Kernel Expression Integer - -This expression also has two different kernels. - - sin(x)**2 + sin(x) + cos(x) - 2 - sin(x) + sin(x) + cos(x) - Type: Expression Integer - -The sin(x) kernel is used twice. - - kernels % - [sin(x),cos(x)] - Type: List Kernel Expression Integer - -An expression need not contain any kernels. - - kernels(1 :: Expression Integer) - [] - Type: List Kernel Expression Integer - -If one or more kernels are present, one of them is designated the main -kernel. - - mainKernel(cos(x) + tan(x)) - tan(x) - Type: Union(Kernel Expression Integer,...) - -Kernels can be nested. Use height to determine the nesting depth. - - height kernel x - 1 - Type: PositiveInteger - -This has height 2 because the x has height 1 and then we apply an -operator to that. - - height mainKernel(sin x) - 2 - Type: PositiveInteger - - height mainKernel(sin cos x) - 3 - Type: PositiveInteger - - height mainKernel(sin cos (tan x + sin x)) - 4 - Type: PositiveInteger - -Use the operator operation to extract the operator component of the -kernel. The operator has type BasicOperator. - - operator mainKernel(sin cos (tan x + sin x)) - sin - Type: BasicOperator - -Use the name operation to extract the name of the operator component -of the kernel. The name has type Symbol. This is really just a -shortcut for a two-step process of extracting the operator and then -calling name on the operator. - - name mainKernel(sin cos (tan x + sin x)) - sin - Type: Symbol - -Axiom knows about functions such as sin, cos and so on and can make -kernels and then expressions using them. To create a kernel and -expression using an arbitrary operator, use operator. - -Now f can be used to create symbolic function applications. - - f := operator 'f - f - Type: BasicOperator - - e := f(x, y, 10) - f(x,y,10) - Type: Expression Integer - -Use the is? operation to learn if the operator component of a kernel -is equal to a given operator. - - is?(e, f) - true - Type: Boolean - -You can also use a symbol or a string as the second argument to is?. - - is?(e, 'f) - true - Type: Boolean - -Use the argument operation to get a list containing the argument -component of a kernel. - - argument mainKernel e - [x,y,10] - Type: List Expression Integer - -Conceptually, an object of type Expression can be thought of a -quotient of multivariate polynomials, where the "variables" are -kernels. The arguments of the kernels are again expressions and so -the structure recurses. See Expression for examples of using kernels -to take apart expression objects. - -See Also: -o )help Expression -o )help BasicOperator -o )show Kernel -o $AXIOM/doc/src/algebra/kl.spad.dvi - -@ -<>= -)abbrev domain KERNEL Kernel -++ Operators applied to elements of a set -++ Author: Manuel Bronstein -++ Date Created: 22 March 1988 -++ Date Last Updated: 10 August 1994 -++ Description: -++ A kernel over a set S is an operator applied to a given list -++ of arguments from S. -Kernel(S:OrderedSet): Exports == Implementation where - O ==> OutputForm - N ==> NonNegativeInteger - OP ==> BasicOperator - - SYMBOL ==> "%symbol" - PMPRED ==> "%pmpredicate" - PMOPT ==> "%pmoptional" - PMMULT ==> "%pmmultiple" - PMCONST ==> "%pmconstant" - SPECIALDISP ==> "%specialDisp" - SPECIALEQUAL ==> "%specialEqual" - SPECIALINPUT ==> "%specialInput" - - Exports ==> Join(CachableSet, Patternable S) with - name : % -> Symbol - ++ name(op(a1,...,an)) returns the name of op. - operator: % -> OP - ++ operator(op(a1,...,an)) returns the operator op. - argument: % -> List S - ++ argument(op(a1,...,an)) returns \spad{[a1,...,an]}. - height : % -> N - ++ height(k) returns the nesting level of k. - kernel : (OP, List S, N) -> % - ++ kernel(op, [a1,...,an], m) returns the kernel \spad{op(a1,...,an)} - ++ of nesting level m. - ++ Error: if op is k-ary for some k not equal to m. - kernel : Symbol -> % - ++ kernel(x) returns x viewed as a kernel. - symbolIfCan: % -> Union(Symbol, "failed") - ++ symbolIfCan(k) returns k viewed as a symbol if k is a symbol, and - ++ "failed" otherwise. - is? : (%, OP) -> Boolean - ++ is?(op(a1,...,an), f) tests if op = f. - is? : (%, Symbol) -> Boolean - ++ is?(op(a1,...,an), s) tests if the name of op is s. - if S has ConvertibleTo InputForm then ConvertibleTo InputForm - - Implementation ==> add - import SortedCache(%) - - Rep := Record(op:OP, arg:List S, nest:N, posit:N) - - clearCache() - - B2Z : Boolean -> Integer - triage: (%, %) -> Integer - preds : OP -> List Any - - is?(k:%, s:Symbol) == is?(operator k, s) - is?(k:%, o:OP) == (operator k) = o - name k == name operator k - height k == k.nest - operator k == k.op - argument k == k.arg - position k == k.posit - setPosition(k, n) == k.posit := n - B2Z flag == (flag => -1; 1) - kernel s == kernel(assert(operator(s,0),SYMBOL), nil(), 1) - - preds o == - (u := property(o, PMPRED)) case "failed" => nil() - (u::None) pretend List(Any) - - symbolIfCan k == - has?(operator k, SYMBOL) => name operator k - "failed" - - k1 = k2 == - if k1.posit = 0 then enterInCache(k1, triage) - if k2.posit = 0 then enterInCache(k2, triage) - k1.posit = k2.posit - - k1 < k2 == - if k1.posit = 0 then enterInCache(k1, triage) - if k2.posit = 0 then enterInCache(k2, triage) - k1.posit < k2.posit - - kernel(fn, x, n) == - ((u := arity fn) case N) and (#x ^= u::N) - => error "Wrong number of arguments" - enterInCache([fn, x, n, 0]$Rep, triage) - - -- SPECIALDISP contains a map List S -> OutputForm - -- it is used when the converting the arguments first is not good, - -- for instance with formal derivatives. - coerce(k:%):OutputForm == - (v := symbolIfCan k) case Symbol => v::Symbol::OutputForm - (f := property(o := operator k, SPECIALDISP)) case None => - ((f::None) pretend (List S -> OutputForm)) (argument k) - l := [x::OutputForm for x in argument k]$List(OutputForm) - (u := display o) case "failed" => prefix(name(o)::OutputForm, l) - (u::(List OutputForm -> OutputForm)) l - - triage(k1, k2) == - k1.nest ^= k2.nest => B2Z(k1.nest < k2.nest) - k1.op ^= k2.op => B2Z(k1.op < k2.op) - (n1 := #(argument k1)) ^= (n2 := #(argument k2)) => B2Z(n1 < n2) - ((func := property(operator k1, SPECIALEQUAL)) case None) and - (((func::None) pretend ((%, %) -> Boolean)) (k1, k2)) => 0 - for x1 in argument(k1) for x2 in argument(k2) repeat - x1 ^= x2 => return B2Z(x1 < x2) - 0 - - if S has ConvertibleTo InputForm then - convert(k:%):InputForm == - (v := symbolIfCan k) case Symbol => convert(v::Symbol)@InputForm - (f := property(o := operator k, SPECIALINPUT)) case None => - ((f::None) pretend (List S -> InputForm)) (argument k) - l := [convert x for x in argument k]$List(InputForm) - (u := input operator k) case "failed" => - convert concat(convert name operator k, l) - (u::(List InputForm -> InputForm)) l - - if S has ConvertibleTo Pattern Integer then - convert(k:%):Pattern(Integer) == - o := operator k - (v := symbolIfCan k) case Symbol => - s := patternVariable(v::Symbol, - has?(o, PMCONST), has?(o, PMOPT), has?(o, PMMULT)) - empty?(l := preds o) => s - setPredicates(s, l) - o [convert x for x in k.arg]$List(Pattern Integer) - - if S has ConvertibleTo Pattern Float then - convert(k:%):Pattern(Float) == - o := operator k - (v := symbolIfCan k) case Symbol => - s := patternVariable(v::Symbol, - has?(o, PMCONST), has?(o, PMOPT), has?(o, PMMULT)) - empty?(l := preds o) => s - setPredicates(s, l) - o [convert x for x in k.arg]$List(Pattern Float) - -@ \section{package KERNEL2 KernelFunctions2} <>= )abbrev package KERNEL2 KernelFunctions2 @@ -639,8 +149,6 @@ KernelFunctions2(R:OrderedSet, S:OrderedSet): with -- op KL expr function <> -<> -<> <> @ \eject diff --git a/src/algebra/laurent.spad.pamphlet b/src/algebra/laurent.spad.pamphlet index 392407d..ef2fd1e 100644 --- a/src/algebra/laurent.spad.pamphlet +++ b/src/algebra/laurent.spad.pamphlet @@ -9,512 +9,6 @@ \eject \tableofcontents \eject -\section{domain ULSCONS UnivariateLaurentSeriesConstructor} -<>= -)abbrev domain ULSCONS UnivariateLaurentSeriesConstructor -++ Authors: Bill Burge, Clifton J. Williamson -++ Date Created: August 1988 -++ Date Last Updated: 17 June 1996 -++ Fix History: -++ 14 June 1996: provided missing exquo: (%,%) -> % (Frederic Lehobey) -++ Basic Operations: -++ Related Domains: -++ Also See: -++ AMS Classifications: -++ Keywords: series, Laurent, Taylor -++ Examples: -++ References: -++ Description: -++ This package enables one to construct a univariate Laurent series -++ domain from a univariate Taylor series domain. Univariate -++ Laurent series are represented by a pair \spad{[n,f(x)]}, where n is -++ an arbitrary integer and \spad{f(x)} is a Taylor series. This pair -++ represents the Laurent series \spad{x**n * f(x)}. -UnivariateLaurentSeriesConstructor(Coef,UTS):_ - Exports == Implementation where - Coef : Ring - UTS : UnivariateTaylorSeriesCategory Coef - I ==> Integer - L ==> List - NNI ==> NonNegativeInteger - OUT ==> OutputForm - P ==> Polynomial Coef - RF ==> Fraction Polynomial Coef - RN ==> Fraction Integer - ST ==> Stream Coef - TERM ==> Record(k:I,c:Coef) - monom ==> monomial$UTS - EFULS ==> ElementaryFunctionsUnivariateLaurentSeries(Coef,UTS,%) - STTAYLOR ==> StreamTaylorSeriesOperations Coef - - Exports ==> UnivariateLaurentSeriesConstructorCategory(Coef,UTS) - - Implementation ==> add - ---% representation - - Rep := Record(expon:I,ps:UTS) - - getExpon : % -> I - getUTS : % -> UTS - - getExpon x == x.expon - getUTS x == x.ps - ---% creation and destruction - - laurent(n,psr) == [n,psr] - taylorRep x == getUTS x - degree x == getExpon x - - 0 == laurent(0,0) - 1 == laurent(0,1) - - monomial(s,e) == laurent(e,s::UTS) - - coerce(uts:UTS):% == laurent(0,uts) - coerce(r:Coef):% == r :: UTS :: % - coerce(i:I):% == i :: Coef :: % - - taylorIfCan uls == - n := getExpon uls - n < 0 => - uls := removeZeroes(-n,uls) - getExpon(uls) < 0 => "failed" - getUTS uls - n = 0 => getUTS uls - getUTS(uls) * monom(1,n :: NNI) - - taylor uls == - (uts := taylorIfCan uls) case "failed" => - error "taylor: Laurent series has a pole" - uts :: UTS - - termExpon: TERM -> I - termExpon term == term.k - termCoef: TERM -> Coef - termCoef term == term.c - rec: (I,Coef) -> TERM - rec(exponent,coef) == [exponent,coef] - - recs: (ST,I) -> Stream TERM - recs(st,n) == delay - empty? st => empty() - zero? (coef := frst st) => recs(rst st,n + 1) - concat(rec(n,coef),recs(rst st,n + 1)) - - terms x == recs(coefficients getUTS x,getExpon x) - - recsToCoefs: (Stream TERM,I) -> ST - recsToCoefs(st,n) == delay - empty? st => empty() - term := frst st; ex := termExpon term - n = ex => concat(termCoef term,recsToCoefs(rst st,n + 1)) - concat(0,recsToCoefs(rst st,n + 1)) - - series st == - empty? st => 0 - ex := termExpon frst st - laurent(ex,series recsToCoefs(st,ex)) - ---% normalizations - - removeZeroes x == - empty? coefficients(xUTS := getUTS x) => 0 - coefficient(xUTS,0) = 0 => - removeZeroes laurent(getExpon(x) + 1,quoByVar xUTS) - x - - removeZeroes(n,x) == - n <= 0 => x - empty? coefficients(xUTS := getUTS x) => 0 - coefficient(xUTS,0) = 0 => - removeZeroes(n - 1,laurent(getExpon(x) + 1,quoByVar xUTS)) - x - ---% predicates - - x = y == - EQ(x,y)$Lisp => true - (expDiff := getExpon(x) - getExpon(y)) = 0 => - getUTS(x) = getUTS(y) - abs(expDiff) > _$streamCount$Lisp => false - expDiff > 0 => - getUTS(x) * monom(1,expDiff :: NNI) = getUTS(y) - getUTS(y) * monom(1,(- expDiff) :: NNI) = getUTS(x) - - pole? x == - (n := degree x) >= 0 => false - x := removeZeroes(-n,x) - degree x < 0 - ---% arithmetic - - x + y == - n := getExpon(x) - getExpon(y) - n >= 0 => - laurent(getExpon y,getUTS(y) + getUTS(x) * monom(1,n::NNI)) - laurent(getExpon x,getUTS(x) + getUTS(y) * monom(1,(-n)::NNI)) - - x - y == - n := getExpon(x) - getExpon(y) - n >= 0 => - laurent(getExpon y,getUTS(x) * monom(1,n::NNI) - getUTS(y)) - laurent(getExpon x,getUTS(x) - getUTS(y) * monom(1,(-n)::NNI)) - - x:% * y:% == laurent(getExpon x + getExpon y,getUTS x * getUTS y) - - x:% ** n:NNI == - zero? n => - zero? x => error "0 ** 0 is undefined" - 1 - laurent(n * getExpon(x),getUTS(x) ** n) - - recip x == - x := removeZeroes(1000,x) - zero? coefficient(x,d := degree x) => "failed" - (uts := recip getUTS x) case "failed" => "failed" - laurent(-d,uts :: UTS) - - elt(uls1:%,uls2:%) == - (uts := taylorIfCan uls2) case "failed" => - error "elt: second argument must have positive order" - uts2 := uts :: UTS - not zero? coefficient(uts2,0) => - error "elt: second argument must have positive order" - if (deg := getExpon uls1) < 0 then uls1 := removeZeroes(-deg,uls1) - (deg := getExpon uls1) < 0 => - (recipr := recip(uts2 :: %)) case "failed" => - error "elt: second argument not invertible" - uts1 := taylor(uls1 * monomial(1,-deg)) - (elt(uts1,uts2) :: %) * (recipr :: %) ** ((-deg) :: NNI) - elt(taylor uls1,uts2) :: % - - eval(uls:%,r:Coef) == - if (n := getExpon uls) < 0 then uls := removeZeroes(-n,uls) - uts := getUTS uls - (n := getExpon uls) < 0 => - zero? r => error "eval: 0 raised to negative power" - (recipr := recip r) case "failed" => - error "eval: non-unit raised to negative power" - (recipr :: Coef) ** ((-n) :: NNI) *$STTAYLOR eval(uts,r) - zero? n => eval(uts,r) - r ** (n :: NNI) *$STTAYLOR eval(uts,r) - ---% values - - variable x == variable getUTS x - center x == center getUTS x - - coefficient(x,n) == - a := n - getExpon(x) - a >= 0 => coefficient(getUTS x,a :: NNI) - 0 - - elt(x:%,n:I) == coefficient(x,n) - ---% other functions - - order x == getExpon x + order getUTS x - order(x,n) == - (m := n - (e := getExpon x)) < 0 => n - e + order(getUTS x,m :: NNI) - - truncate(x,n) == - (m := n - (e := getExpon x)) < 0 => 0 - laurent(e,truncate(getUTS x,m :: NNI)) - - truncate(x,n1,n2) == - if n2 < n1 then (n1,n2) := (n2,n1) - (m1 := n1 - (e := getExpon x)) < 0 => truncate(x,n2) - laurent(e,truncate(getUTS x,m1 :: NNI,(n2 - e) :: NNI)) - - if Coef has IntegralDomain then - rationalFunction(x,n) == - (m := n - (e := getExpon x)) < 0 => 0 - poly := polynomial(getUTS x,m :: NNI) :: RF - zero? e => poly - v := variable(x) :: RF; c := center(x) :: P :: RF - positive? e => poly * (v - c) ** (e :: NNI) - poly / (v - c) ** ((-e) :: NNI) - - rationalFunction(x,n1,n2) == - if n2 < n1 then (n1,n2) := (n2,n1) - (m1 := n1 - (e := getExpon x)) < 0 => rationalFunction(x,n2) - poly := polynomial(getUTS x,m1 :: NNI,(n2 - e) :: NNI) :: RF - zero? e => poly - v := variable(x) :: RF; c := center(x) :: P :: RF - positive? e => poly * (v - c) ** (e :: NNI) - poly / (v - c) ** ((-e) :: NNI) - - -- La fonction < exquo > manque dans laurent.spad, - --les lignes suivantes le mettent en evidence : - -- - --ls := laurent(0,series [i for i in 1..])$ULS(INT,x,0) - ---- missing function in laurent.spad of Axiom 2.0a version of - ---- Friday March 10, 1995 at 04:15:22 on 615: - --exquo(ls,ls) - -- - -- Je l'ai ajoutee a laurent.spad. - -- - --Frederic Lehobey - x exquo y == - x := removeZeroes(1000,x) - y := removeZeroes(1000,y) - zero? coefficient(y, d := degree y) => "failed" - (uts := (getUTS x) exquo (getUTS y)) case "failed" => "failed" - laurent(degree x-d,uts :: UTS) - - if Coef has coerce: Symbol -> Coef then - if Coef has "**": (Coef,I) -> Coef then - - approximate(x,n) == - (m := n - (e := getExpon x)) < 0 => 0 - app := approximate(getUTS x,m :: NNI) - zero? e => app - app * ((variable(x) :: Coef) - center(x)) ** e - - complete x == laurent(getExpon x,complete getUTS x) - extend(x,n) == - e := getExpon x - (m := n - e) < 0 => x - laurent(e,extend(getUTS x,m :: NNI)) - - map(f:Coef -> Coef,x:%) == laurent(getExpon x,map(f,getUTS x)) - - multiplyCoefficients(f,x) == - e := getExpon x - laurent(e,multiplyCoefficients(f(e + #1),getUTS x)) - - multiplyExponents(x,n) == - laurent(n * getExpon x,multiplyExponents(getUTS x,n)) - - differentiate x == - e := getExpon x - laurent(e - 1,multiplyCoefficients((e + #1) :: Coef,getUTS x)) - - if Coef has PartialDifferentialRing(Symbol) then - differentiate(x:%,s:Symbol) == - (s = variable(x)) => differentiate x - map(differentiate(#1,s),x) - differentiate(center x,s)*differentiate(x) - - characteristic() == characteristic()$Coef - - if Coef has Field then - - retract(x:%):UTS == taylor x - retractIfCan(x:%):Union(UTS,"failed") == taylorIfCan x - - (x:%) ** (n:I) == - zero? n => - zero? x => error "0 ** 0 is undefined" - 1 - n > 0 => laurent(n * getExpon(x),getUTS(x) ** (n :: NNI)) - xInv := inv x; minusN := (-n) :: NNI - laurent(minusN * getExpon(xInv),getUTS(xInv) ** minusN) - - (x:UTS) * (y:%) == (x :: %) * y - (x:%) * (y:UTS) == x * (y :: %) - - inv x == - (xInv := recip x) case "failed" => - error "multiplicative inverse does not exist" - xInv :: % - - (x:%) / (y:%) == - (yInv := recip y) case "failed" => - error "inv: multiplicative inverse does not exist" - x * (yInv :: %) - - (x:UTS) / (y:UTS) == (x :: %) / (y :: %) - - numer x == - (n := degree x) >= 0 => taylor x - x := removeZeroes(-n,x) - (n := degree x) = 0 => taylor x - getUTS x - - denom x == - (n := degree x) >= 0 => 1 - x := removeZeroes(-n,x) - (n := degree x) = 0 => 1 - monom(1,(-n) :: NNI) - ---% algebraic and transcendental functions - - if Coef has Algebra Fraction Integer then - - coerce(r:RN) == r :: Coef :: % - - if Coef has Field then - (x:%) ** (r:RN) == x **$EFULS r - - exp x == exp(x)$EFULS - log x == log(x)$EFULS - sin x == sin(x)$EFULS - cos x == cos(x)$EFULS - tan x == tan(x)$EFULS - cot x == cot(x)$EFULS - sec x == sec(x)$EFULS - csc x == csc(x)$EFULS - asin x == asin(x)$EFULS - acos x == acos(x)$EFULS - atan x == atan(x)$EFULS - acot x == acot(x)$EFULS - asec x == asec(x)$EFULS - acsc x == acsc(x)$EFULS - sinh x == sinh(x)$EFULS - cosh x == cosh(x)$EFULS - tanh x == tanh(x)$EFULS - coth x == coth(x)$EFULS - sech x == sech(x)$EFULS - csch x == csch(x)$EFULS - asinh x == asinh(x)$EFULS - acosh x == acosh(x)$EFULS - atanh x == atanh(x)$EFULS - acoth x == acoth(x)$EFULS - asech x == asech(x)$EFULS - acsch x == acsch(x)$EFULS - - ratInv: I -> Coef - ratInv n == - zero? n => 1 - inv(n :: RN) :: Coef - - integrate x == - not zero? coefficient(x,-1) => - error "integrate: series has term of order -1" - e := getExpon x - laurent(e + 1,multiplyCoefficients(ratInv(e + 1 + #1),getUTS x)) - - if Coef has integrate: (Coef,Symbol) -> Coef and _ - Coef has variables: Coef -> List Symbol then - integrate(x:%,s:Symbol) == - (s = variable(x)) => integrate x - not entry?(s,variables center x) => map(integrate(#1,s),x) - error "integrate: center is a function of variable of integration" - - if Coef has TranscendentalFunctionCategory and _ - Coef has PrimitiveFunctionCategory and _ - Coef has AlgebraicallyClosedFunctionSpace Integer then - - integrateWithOneAnswer: (Coef,Symbol) -> Coef - integrateWithOneAnswer(f,s) == - res := integrate(f,s)$FunctionSpaceIntegration(I,Coef) - res case Coef => res :: Coef - first(res :: List Coef) - - integrate(x:%,s:Symbol) == - (s = variable(x)) => integrate x - not entry?(s,variables center x) => - map(integrateWithOneAnswer(#1,s),x) - error "integrate: center is a function of variable of integration" - - termOutput:(I,Coef,OUT) -> OUT - termOutput(k,c,vv) == - -- creates a term c * vv ** k - k = 0 => c :: OUT - mon := - k = 1 => vv - vv ** (k :: OUT) - c = 1 => mon - c = -1 => -mon - (c :: OUT) * mon - - showAll?:() -> Boolean - -- check a global Lisp variable - showAll?() == true - - termsToOutputForm:(I,ST,OUT) -> OUT - termsToOutputForm(m,uu,xxx) == - l : L OUT := empty() - empty? uu => (0$Coef) :: OUT - n : NNI ; count : NNI := _$streamCount$Lisp - for n in 0..count while not empty? uu repeat - if frst(uu) ^= 0 then - l := concat(termOutput((n :: I) + m,frst(uu),xxx),l) - uu := rst uu - if showAll?() then - for n in (count + 1).. while explicitEntries? uu and _ - not eq?(uu,rst uu) repeat - if frst(uu) ^= 0 then - l := concat(termOutput((n::I) + m,frst(uu),xxx),l) - uu := rst uu - l := - explicitlyEmpty? uu => l - eq?(uu,rst uu) and frst uu = 0 => l - concat(prefix("O" :: OUT,[xxx ** ((n :: I) + m) :: OUT]),l) - empty? l => (0$Coef) :: OUT - reduce("+",reverse_! l) - - coerce(x:%):OUT == - x := removeZeroes(_$streamCount$Lisp,x) - m := degree x - uts := getUTS x - p := coefficients uts - var := variable uts; cen := center uts - xxx := - zero? cen => var :: OUT - paren(var :: OUT - cen :: OUT) - termsToOutputForm(m,p,xxx) - -@ -\section{domain ULS UnivariateLaurentSeries} -<>= -)abbrev domain ULS UnivariateLaurentSeries -++ Author: Clifton J. Williamson -++ Date Created: 18 January 1990 -++ Date Last Updated: 21 September 1993 -++ Basic Operations: -++ Related Domains: -++ Also See: -++ AMS Classifications: -++ Keywords: series, Laurent -++ Examples: -++ References: -++ Description: Dense Laurent series in one variable -++ \spadtype{UnivariateLaurentSeries} is a domain representing Laurent -++ series in one variable with coefficients in an arbitrary ring. The -++ parameters of the type specify the coefficient ring, the power series -++ variable, and the center of the power series expansion. For example, -++ \spad{UnivariateLaurentSeries(Integer,x,3)} represents Laurent series in -++ \spad{(x - 3)} with integer coefficients. -UnivariateLaurentSeries(Coef,var,cen): Exports == Implementation where - Coef : Ring - var : Symbol - cen : Coef - I ==> Integer - UTS ==> UnivariateTaylorSeries(Coef,var,cen) - - Exports ==> UnivariateLaurentSeriesConstructorCategory(Coef,UTS) with - coerce: Variable(var) -> % - ++ \spad{coerce(var)} converts the series variable \spad{var} into a - ++ Laurent series. - differentiate: (%,Variable(var)) -> % - ++ \spad{differentiate(f(x),x)} returns the derivative of - ++ \spad{f(x)} with respect to \spad{x}. - if Coef has Algebra Fraction Integer then - integrate: (%,Variable(var)) -> % - ++ \spad{integrate(f(x))} returns an anti-derivative of the power - ++ series \spad{f(x)} with constant coefficient 0. - ++ We may integrate a series when we can divide coefficients - ++ by integers. - - Implementation ==> UnivariateLaurentSeriesConstructor(Coef,UTS) add - - variable x == var - center x == cen - - coerce(v:Variable(var)) == - zero? cen => monomial(1,1) - monomial(1,1) + monomial(cen,0) - - differentiate(x:%,v:Variable(var)) == differentiate x - - if Coef has Algebra Fraction Integer then - integrate(x:%,v:Variable(var)) == integrate x - -@ \section{package ULS2 UnivariateLaurentSeriesFunctions2} <>= )abbrev package ULS2 UnivariateLaurentSeriesFunctions2 @@ -591,8 +85,6 @@ UnivariateLaurentSeriesFunctions2(Coef1,Coef2,var1,var2,cen1,cen2):_ <<*>>= <> -<> -<> <> @ \eject diff --git a/src/algebra/lie.spad.pamphlet b/src/algebra/lie.spad.pamphlet deleted file mode 100644 index c5822d7..0000000 --- a/src/algebra/lie.spad.pamphlet +++ /dev/null @@ -1,259 +0,0 @@ -\documentclass{article} -\usepackage{axiom} -\begin{document} -\title{\$SPAD/src/algebra lie.spad} -\author{Johannes Grabmeier} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject -\section{domain LIE AssociatedLieAlgebra} -<>= -)abbrev domain LIE AssociatedLieAlgebra -++ Author: J. Grabmeier -++ Date Created: 07 March 1991 -++ Date Last Updated: 14 June 1991 -++ Basic Operations: *,**,+,- -++ Related Constructors: -++ Also See: -++ AMS Classifications: -++ Keywords: associated Liealgebra -++ References: -++ Description: -++ AssociatedLieAlgebra takes an algebra \spad{A} -++ and uses \spadfun{*$A} to define the -++ Lie bracket \spad{a*b := (a *$A b - b *$A a)} (commutator). Note that -++ the notation \spad{[a,b]} cannot be used due to -++ restrictions of the current compiler. -++ This domain only gives a Lie algebra if the -++ Jacobi-identity \spad{(a*b)*c + (b*c)*a + (c*a)*b = 0} holds -++ for all \spad{a},\spad{b},\spad{c} in \spad{A}. -++ This relation can be checked by -++ \spad{lieAdmissible?()$A}. -++ -++ If the underlying algebra is of type -++ \spadtype{FramedNonAssociativeAlgebra(R)} (i.e. a non -++ associative algebra over R which is a free \spad{R}-module of finite -++ rank, together with a fixed \spad{R}-module basis), then the same -++ is true for the associated Lie algebra. -++ Also, if the underlying algebra is of type -++ \spadtype{FiniteRankNonAssociativeAlgebra(R)} (i.e. a non -++ associative algebra over R which is a free R-module of finite -++ rank), then the same is true for the associated Lie algebra. - -AssociatedLieAlgebra(R:CommutativeRing,A:NonAssociativeAlgebra R): - public == private where - public ==> Join (NonAssociativeAlgebra R, CoercibleTo A) with - coerce : A -> % - ++ coerce(a) coerces the element \spad{a} of the algebra \spad{A} - ++ to an element of the Lie - ++ algebra \spadtype{AssociatedLieAlgebra}(R,A). - if A has FramedNonAssociativeAlgebra(R) then - FramedNonAssociativeAlgebra(R) - if A has FiniteRankNonAssociativeAlgebra(R) then - FiniteRankNonAssociativeAlgebra(R) - - private ==> A add - Rep := A - (a:%) * (b:%) == (a::Rep) * $Rep (b::Rep) -$Rep (b::Rep) * $Rep (a::Rep) - coerce(a:%):A == a :: Rep - coerce(a:A):% == a :: % - (a:%) ** (n:PositiveInteger) == - n = 1 => a - 0 - -@ -\section{domain JORDAN AssociatedJordanAlgebra} -<>= -)abbrev domain JORDAN AssociatedJordanAlgebra -++ Author: J. Grabmeier -++ Date Created: 14 June 1991 -++ Date Last Updated: 14 June 1991 -++ Basic Operations: *,**,+,- -++ Related Constructors: -++ Also See: -++ AMS Classifications: -++ Keywords: associated Jordan algebra -++ References: -++ Description: -++ AssociatedJordanAlgebra takes an algebra \spad{A} and uses \spadfun{*$A} -++ to define the new multiplications \spad{a*b := (a *$A b + b *$A a)/2} -++ (anticommutator). -++ The usual notation \spad{{a,b}_+} cannot be used due to -++ restrictions in the current language. -++ This domain only gives a Jordan algebra if the -++ Jordan-identity \spad{(a*b)*c + (b*c)*a + (c*a)*b = 0} holds -++ for all \spad{a},\spad{b},\spad{c} in \spad{A}. -++ This relation can be checked by -++ \spadfun{jordanAdmissible?()$A}. -++ -++ If the underlying algebra is of type -++ \spadtype{FramedNonAssociativeAlgebra(R)} (i.e. a non -++ associative algebra over R which is a free R-module of finite -++ rank, together with a fixed R-module basis), then the same -++ is true for the associated Jordan algebra. -++ Moreover, if the underlying algebra is of type -++ \spadtype{FiniteRankNonAssociativeAlgebra(R)} (i.e. a non -++ associative algebra over R which is a free R-module of finite -++ rank), then the same true for the associated Jordan algebra. - -AssociatedJordanAlgebra(R:CommutativeRing,A:NonAssociativeAlgebra R): - public == private where - public ==> Join (NonAssociativeAlgebra R, CoercibleTo A) with - coerce : A -> % - ++ coerce(a) coerces the element \spad{a} of the algebra \spad{A} - ++ to an element of the Jordan algebra - ++ \spadtype{AssociatedJordanAlgebra}(R,A). - if A has FramedNonAssociativeAlgebra(R) then _ - FramedNonAssociativeAlgebra(R) - if A has FiniteRankNonAssociativeAlgebra(R) then _ - FiniteRankNonAssociativeAlgebra(R) - - private ==> A add - Rep := A - two : R := (1$R + 1$R) - oneHalf : R := (recip two) :: R - (a:%) * (b:%) == - zero? two => error - "constructor must no be called with Ring of characteristic 2" - ((a::Rep) * $Rep (b::Rep) +$Rep (b::Rep) * $Rep (a::Rep)) * oneHalf - -- (a::Rep) * $Rep (b::Rep) +$Rep (b::Rep) * $Rep (a::Rep) - coerce(a:%):A == a :: Rep - coerce(a:A):% == a :: % - (a:%) ** (n:PositiveInteger) == a - -@ -\section{domain LSQM LieSquareMatrix} -<>= -)abbrev domain LSQM LieSquareMatrix -++ Author: J. Grabmeier -++ Date Created: 07 March 1991 -++ Date Last Updated: 08 March 1991 -++ Basic Operations: -++ Related Constructors: -++ Also See: -++ AMS Classifications: -++ Keywords: -++ References: -++ Description: -++ LieSquareMatrix(n,R) implements the Lie algebra of the n by n -++ matrices over the commutative ring R. -++ The Lie bracket (commutator) of the algebra is given by -++ \spad{a*b := (a *$SQMATRIX(n,R) b - b *$SQMATRIX(n,R) a)}, -++ where \spadfun{*$SQMATRIX(n,R)} is the usual matrix multiplication. -LieSquareMatrix(n,R): Exports == Implementation where - - n : PositiveInteger - R : CommutativeRing - - Row ==> DirectProduct(n,R) - Col ==> DirectProduct(n,R) - - Exports ==> Join(SquareMatrixCategory(n,R,Row,Col), CoercibleTo Matrix R,_ - FramedNonAssociativeAlgebra R) --with - - Implementation ==> AssociatedLieAlgebra (R,SquareMatrix(n, R)) add - - Rep := AssociatedLieAlgebra (R,SquareMatrix(n, R)) - -- local functions - n2 : PositiveInteger := n*n - - convDM : DirectProduct(n2,R) -> % - conv : DirectProduct(n2,R) -> SquareMatrix(n,R) - --++ converts n2-vector to (n,n)-matrix row by row - conv v == - cond : Matrix(R) := new(n,n,0$R)$Matrix(R) - z : Integer := 0 - for i in 1..n repeat - for j in 1..n repeat - z := z+1 - setelt(cond,i,j,v.z) - squareMatrix(cond)$SquareMatrix(n, R) - - - coordinates(a:%,b:Vector(%)):Vector(R) == - -- only valid for b canonicalBasis - res : Vector R := new(n2,0$R) - z : Integer := 0 - for i in 1..n repeat - for j in 1..n repeat - z := z+1 - res.z := elt(a,i,j)$% - res - - - convDM v == - sq := conv v - coerce(sq)$Rep :: % - - basis() == - n2 : PositiveInteger := n*n - ldp : List DirectProduct(n2,R) := - [unitVector(i::PositiveInteger)$DirectProduct(n2,R) for i in 1..n2] - res:Vector % := vector map(convDM,_ - ldp)$ListFunctions2(DirectProduct(n2,R), %) - - someBasis() == basis() - rank() == n*n - - --- transpose: % -> % --- ++ computes the transpose of a matrix --- squareMatrix: Matrix R -> % --- ++ converts a Matrix to a LieSquareMatrix --- coerce: % -> Matrix R --- ++ converts a LieSquareMatrix to a Matrix --- symdecomp : % -> Record(sym:%,antisym:%) --- if R has commutative("*") then --- minorsVect: -> Vector(Union(R,"uncomputed")) --range: 1..2**n-1 --- if R has commutative("*") then central --- if R has commutative("*") and R has unitsKnown then unitsKnown - -@ -\section{License} -<>= ---Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. ---All rights reserved. --- ---Redistribution and use in source and binary forms, with or without ---modification, are permitted provided that the following conditions are ---met: --- --- - Redistributions of source code must retain the above copyright --- notice, this list of conditions and the following disclaimer. --- --- - Redistributions in binary form must reproduce the above copyright --- notice, this list of conditions and the following disclaimer in --- the documentation and/or other materials provided with the --- distribution. --- --- - Neither the name of The Numerical ALgorithms Group Ltd. nor the --- names of its contributors may be used to endorse or promote products --- derived from this software without specific prior written permission. --- ---THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS ---IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ---TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A ---PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER ---OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ---EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ---PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ---PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ---LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ---NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ---SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -@ -<<*>>= -<> - -<> -<> -<> -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document} diff --git a/src/algebra/list.spad.pamphlet b/src/algebra/list.spad.pamphlet index 4292df0..4e2b7c4 100644 --- a/src/algebra/list.spad.pamphlet +++ b/src/algebra/list.spad.pamphlet @@ -9,1052 +9,6 @@ \eject \tableofcontents \eject -\section{domain ILIST IndexedList} -<>= -)abbrev domain ILIST IndexedList -++ Author: Michael Monagan -++ Date Created: Sep 1987 -++ Change History: -++ Basic Operations: -++ \#, concat, concat!, construct, copy, elt, elt, empty, -++ empty?, eq?, first, member?, merge!, mergeSort, minIndex, -++ parts, removeDuplicates!, rest, rest, reverse, reverse!, -++ setelt, setfirst!, setrest!, sort!, split! -++ Related Constructors: List -++ Also See: -++ AMS Classification: -++ Keywords: list, aggregate, index -++ Description: -++ \spadtype{IndexedList} is a basic implementation of the functions -++ in \spadtype{ListAggregate}, often using functions in the underlying -++ LISP system. The second parameter to the constructor (\spad{mn}) -++ is the beginning index of the list. That is, if \spad{l} is a -++ list, then \spad{elt(l,mn)} is the first value. This constructor -++ is probably best viewed as the implementation of singly-linked -++ lists that are addressable by index rather than as a mere wrapper -++ for LISP lists. -IndexedList(S:Type, mn:Integer): Exports == Implementation where - cycleMax ==> 1000 -- value used in checking for cycles - --- The following seems to be a bit out of date, but is kept in case --- a knowledgeable person wants to update it: --- The following LISP dependencies are divided into two groups --- Those that are required --- CONS, EQ, NIL, NULL, QCAR, QCDR, RPLACA, RPLACD --- Those that are included for efficiency only --- NEQ, LIST, CAR, CDR, NCONC2, NREVERSE, LENGTH --- Also REVERSE, since it's called in Polynomial Ring - - Qfirst ==> QCAR$Lisp - Qrest ==> QCDR$Lisp - Qnull ==> NULL$Lisp - Qeq ==> EQ$Lisp - Qneq ==> NEQ$Lisp - Qcons ==> CONS$Lisp - Qpush ==> PUSH$Lisp - - Exports ==> ListAggregate S - Implementation ==> - add - #x == LENGTH(x)$Lisp - concat(s:S,x:%) == CONS(s,x)$Lisp - eq?(x,y) == EQ(x,y)$Lisp - first x == SPADfirst(x)$Lisp - elt(x,"first") == SPADfirst(x)$Lisp - empty() == NIL$Lisp - empty? x == NULL(x)$Lisp - rest x == CDR(x)$Lisp - elt(x,"rest") == CDR(x)$Lisp - setfirst_!(x,s) == - empty? x => error "Cannot update an empty list" - Qfirst RPLACA(x,s)$Lisp - setelt(x,"first",s) == - empty? x => error "Cannot update an empty list" - Qfirst RPLACA(x,s)$Lisp - setrest_!(x,y) == - empty? x => error "Cannot update an empty list" - Qrest RPLACD(x,y)$Lisp - setelt(x,"rest",y) == - empty? x => error "Cannot update an empty list" - Qrest RPLACD(x,y)$Lisp - construct l == l pretend % - parts s == s pretend List S - reverse_! x == NREVERSE(x)$Lisp - reverse x == REVERSE(x)$Lisp - minIndex x == mn - - rest(x, n) == - for i in 1..n repeat - if Qnull x then error "index out of range" - x := Qrest x - x - - copy x == - y := empty() - for i in 0.. while not Qnull x repeat - if Qeq(i,cycleMax) and cyclic? x then error "cyclic list" - y := Qcons(Qfirst x,y) - x := Qrest x - (NREVERSE(y)$Lisp)@% - - if S has SetCategory then - coerce(x):OutputForm == - -- displays cycle with overbar over the cycle - y := empty()$List(OutputForm) - s := cycleEntry x - while Qneq(x, s) repeat - y := concat((first x)::OutputForm, y) - x := rest x - y := reverse_! y - empty? s => bracket y - -- cyclic case: z is cylic part - z := list((first x)::OutputForm) - while Qneq(s, rest x) repeat - x := rest x - z := concat((first x)::OutputForm, z) - bracket concat_!(y, overbar commaSeparate reverse_! z) - - x = y == - Qeq(x,y) => true - while not Qnull x and not Qnull y repeat - Qfirst x ^=$S Qfirst y => return false - x := Qrest x - y := Qrest y - Qnull x and Qnull y - - latex(x : %): String == - s : String := "\left[" - while not Qnull x repeat - s := concat(s, latex(Qfirst x)$S)$String - x := Qrest x - if not Qnull x then s := concat(s, ", ")$String - concat(s, " \right]")$String - - member?(s,x) == - while not Qnull x repeat - if s = Qfirst x then return true else x := Qrest x - false - - -- Lots of code from parts of AGGCAT, repeated here to - -- get faster compilation - concat_!(x:%,y:%) == - Qnull x => - Qnull y => x - Qpush(first y,x) - QRPLACD(x,rest y)$Lisp - x - z:=x - while not Qnull Qrest z repeat - z:=Qrest z - QRPLACD(z,y)$Lisp - x - - -- Then a quicky: - if S has SetCategory then - removeDuplicates_! l == - p := l - while not Qnull p repeat --- p := setrest_!(p, remove_!(#1 = Qfirst p, Qrest p)) --- far too expensive - builds closures etc. - pp:=p - f:S:=Qfirst p - p:=Qrest p - while not Qnull (pr:=Qrest pp) repeat - if (Qfirst pr)@S = f then QRPLACD(pp,Qrest pr)$Lisp - else pp:=pr - l - - -- then sorting - mergeSort: ((S, S) -> Boolean, %, Integer) -> % - - sort_!(f, l) == mergeSort(f, l, #l) - - merge_!(f, p, q) == - Qnull p => q - Qnull q => p - Qeq(p, q) => error "cannot merge a list into itself" - if f(Qfirst p, Qfirst q) - then (r := t := p; p := Qrest p) - else (r := t := q; q := Qrest q) - while not Qnull p and not Qnull q repeat - if f(Qfirst p, Qfirst q) - then (QRPLACD(t, p)$Lisp; t := p; p := Qrest p) - else (QRPLACD(t, q)$Lisp; t := q; q := Qrest q) - QRPLACD(t, if Qnull p then q else p)$Lisp - r - - split_!(p, n) == - n < 1 => error "index out of range" - p := rest(p, (n - 1)::NonNegativeInteger) - q := Qrest p - QRPLACD(p, NIL$Lisp)$Lisp - q - - mergeSort(f, p, n) == - if n = 2 and f(first rest p, first p) then p := reverse_! p - n < 3 => p - l := (n quo 2)::NonNegativeInteger - q := split_!(p, l) - p := mergeSort(f, p, l) - q := mergeSort(f, q, n - l) - merge_!(f, p, q) - -@ -\section{ILIST.lsp BOOTSTRAP} -{\bf ILIST} depends on a chain of -files. We need to break this cycle to build the algebra. So we keep a -cached copy of the translated {\bf ILIST} category which we can write -into the {\bf MID} directory. We compile the lisp code and copy the -{\bf ILIST.o} file to the {\bf OUT} directory. This is eventually -forcibly replaced by a recompiled version. - -Note that this code is not included in the generated catdef.spad file. - -<>= - -(|/VERSIONCHECK| 2) - -(PUT (QUOTE |ILIST;#;$Nni;1|) (QUOTE |SPADreplace|) (QUOTE LENGTH)) - -(DEFUN |ILIST;#;$Nni;1| (|x| |$|) (LENGTH |x|)) - -(PUT (QUOTE |ILIST;concat;S2$;2|) (QUOTE |SPADreplace|) (QUOTE CONS)) - -(DEFUN |ILIST;concat;S2$;2| (|s| |x| |$|) (CONS |s| |x|)) - -(PUT (QUOTE |ILIST;eq?;2$B;3|) (QUOTE |SPADreplace|) (QUOTE EQ)) - -(DEFUN |ILIST;eq?;2$B;3| (|x| |y| |$|) (EQ |x| |y|)) - -(PUT (QUOTE |ILIST;first;$S;4|) (QUOTE |SPADreplace|) (QUOTE |SPADfirst|)) - -(DEFUN |ILIST;first;$S;4| (|x| |$|) (|SPADfirst| |x|)) - -(PUT (QUOTE |ILIST;elt;$firstS;5|) (QUOTE |SPADreplace|) (QUOTE (XLAM (|x| "first") (|SPADfirst| |x|)))) - -(DEFUN |ILIST;elt;$firstS;5| (|x| G101995 |$|) (|SPADfirst| |x|)) - -(PUT (QUOTE |ILIST;empty;$;6|) (QUOTE |SPADreplace|) (QUOTE (XLAM NIL NIL))) - -(DEFUN |ILIST;empty;$;6| (|$|) NIL) - -(PUT (QUOTE |ILIST;empty?;$B;7|) (QUOTE |SPADreplace|) (QUOTE NULL)) - -(DEFUN |ILIST;empty?;$B;7| (|x| |$|) (NULL |x|)) - -(PUT (QUOTE |ILIST;rest;2$;8|) (QUOTE |SPADreplace|) (QUOTE CDR)) - -(DEFUN |ILIST;rest;2$;8| (|x| |$|) (CDR |x|)) - -(PUT (QUOTE |ILIST;elt;$rest$;9|) (QUOTE |SPADreplace|) (QUOTE (XLAM (|x| "rest") (CDR |x|)))) - -(DEFUN |ILIST;elt;$rest$;9| (|x| G102000 |$|) (CDR |x|)) - -(DEFUN |ILIST;setfirst!;$2S;10| (|x| |s| |$|) (COND ((SPADCALL |x| (QREFELT |$| 17)) (|error| "Cannot update an empty list")) ((QUOTE T) (QCAR (RPLACA |x| |s|))))) - -(DEFUN |ILIST;setelt;$first2S;11| (|x| G102005 |s| |$|) (COND ((SPADCALL |x| (QREFELT |$| 17)) (|error| "Cannot update an empty list")) ((QUOTE T) (QCAR (RPLACA |x| |s|))))) - -(DEFUN |ILIST;setrest!;3$;12| (|x| |y| |$|) (COND ((SPADCALL |x| (QREFELT |$| 17)) (|error| "Cannot update an empty list")) ((QUOTE T) (QCDR (RPLACD |x| |y|))))) - -(DEFUN |ILIST;setelt;$rest2$;13| (|x| G102010 |y| |$|) (COND ((SPADCALL |x| (QREFELT |$| 17)) (|error| "Cannot update an empty list")) ((QUOTE T) (QCDR (RPLACD |x| |y|))))) - -(PUT (QUOTE |ILIST;construct;L$;14|) (QUOTE |SPADreplace|) (QUOTE (XLAM (|l|) |l|))) - -(DEFUN |ILIST;construct;L$;14| (|l| |$|) |l|) - -(PUT (QUOTE |ILIST;parts;$L;15|) (QUOTE |SPADreplace|) (QUOTE (XLAM (|s|) |s|))) - -(DEFUN |ILIST;parts;$L;15| (|s| |$|) |s|) - -(PUT (QUOTE |ILIST;reverse!;2$;16|) (QUOTE |SPADreplace|) (QUOTE NREVERSE)) - -(DEFUN |ILIST;reverse!;2$;16| (|x| |$|) (NREVERSE |x|)) - -(PUT (QUOTE |ILIST;reverse;2$;17|) (QUOTE |SPADreplace|) (QUOTE REVERSE)) - -(DEFUN |ILIST;reverse;2$;17| (|x| |$|) (REVERSE |x|)) - -(DEFUN |ILIST;minIndex;$I;18| (|x| |$|) (QREFELT |$| 7)) - -(DEFUN |ILIST;rest;$Nni$;19| (|x| |n| |$|) (PROG (|i|) (RETURN (SEQ (SEQ (LETT |i| 1 |ILIST;rest;$Nni$;19|) G190 (COND ((QSGREATERP |i| |n|) (GO G191))) (SEQ (COND ((NULL |x|) (|error| "index out of range"))) (EXIT (LETT |x| (QCDR |x|) |ILIST;rest;$Nni$;19|))) (LETT |i| (QSADD1 |i|) |ILIST;rest;$Nni$;19|) (GO G190) G191 (EXIT NIL)) (EXIT |x|))))) - -(DEFUN |ILIST;copy;2$;20| (|x| |$|) (PROG (|i| |y|) (RETURN (SEQ (LETT |y| (SPADCALL (QREFELT |$| 16)) |ILIST;copy;2$;20|) (SEQ (LETT |i| 0 |ILIST;copy;2$;20|) G190 (COND ((NULL (COND ((NULL |x|) (QUOTE NIL)) ((QUOTE T) (QUOTE T)))) (GO G191))) (SEQ (COND ((EQ |i| 1000) (COND ((SPADCALL |x| (QREFELT |$| 33)) (|error| "cyclic list"))))) (LETT |y| (CONS (QCAR |x|) |y|) |ILIST;copy;2$;20|) (EXIT (LETT |x| (QCDR |x|) |ILIST;copy;2$;20|))) (LETT |i| (QSADD1 |i|) |ILIST;copy;2$;20|) (GO G190) G191 (EXIT NIL)) (EXIT (NREVERSE |y|)))))) - -(DEFUN |ILIST;coerce;$Of;21| (|x| |$|) (PROG (|s| |y| |z|) (RETURN (SEQ (LETT |y| NIL |ILIST;coerce;$Of;21|) (LETT |s| (SPADCALL |x| (QREFELT |$| 35)) |ILIST;coerce;$Of;21|) (SEQ G190 (COND ((NULL (NEQ |x| |s|)) (GO G191))) (SEQ (LETT |y| (CONS (SPADCALL (SPADCALL |x| (QREFELT |$| 13)) (QREFELT |$| 37)) |y|) |ILIST;coerce;$Of;21|) (EXIT (LETT |x| (SPADCALL |x| (QREFELT |$| 18)) |ILIST;coerce;$Of;21|))) NIL (GO G190) G191 (EXIT NIL)) (LETT |y| (NREVERSE |y|) |ILIST;coerce;$Of;21|) (EXIT (COND ((SPADCALL |s| (QREFELT |$| 17)) (SPADCALL |y| (QREFELT |$| 39))) ((QUOTE T) (SEQ (LETT |z| (SPADCALL (SPADCALL (SPADCALL |x| (QREFELT |$| 13)) (QREFELT |$| 37)) (QREFELT |$| 41)) |ILIST;coerce;$Of;21|) (SEQ G190 (COND ((NULL (NEQ |s| (SPADCALL |x| (QREFELT |$| 18)))) (GO G191))) (SEQ (LETT |x| (SPADCALL |x| (QREFELT |$| 18)) |ILIST;coerce;$Of;21|) (EXIT (LETT |z| (CONS (SPADCALL (SPADCALL |x| (QREFELT |$| 13)) (QREFELT |$| 37)) |z|) |ILIST;coerce;$Of;21|))) NIL (GO G190) G191 (EXIT NIL)) (EXIT (SPADCALL (SPADCALL |y| (SPADCALL (SPADCALL (NREVERSE |z|) (QREFELT |$| 42)) (QREFELT |$| 43)) (QREFELT |$| 44)) (QREFELT |$| 39))))))))))) - -(DEFUN |ILIST;=;2$B;22| (|x| |y| |$|) (PROG (#1=#:G102042) (RETURN (SEQ (EXIT (COND ((EQ |x| |y|) (QUOTE T)) ((QUOTE T) (SEQ (SEQ G190 (COND ((NULL (COND ((OR (NULL |x|) (NULL |y|)) (QUOTE NIL)) ((QUOTE T) (QUOTE T)))) (GO G191))) (SEQ (EXIT (COND ((NULL (SPADCALL (QCAR |x|) (QCAR |y|) (QREFELT |$| 46))) (PROGN (LETT #1# (QUOTE NIL) |ILIST;=;2$B;22|) (GO #1#))) ((QUOTE T) (SEQ (LETT |x| (QCDR |x|) |ILIST;=;2$B;22|) (EXIT (LETT |y| (QCDR |y|) |ILIST;=;2$B;22|))))))) NIL (GO G190) G191 (EXIT NIL)) (EXIT (COND ((NULL |x|) (NULL |y|)) ((QUOTE T) (QUOTE NIL)))))))) #1# (EXIT #1#))))) - -(DEFUN |ILIST;latex;$S;23| (|x| |$|) (PROG (|s|) (RETURN (SEQ (LETT |s| "\\left[" |ILIST;latex;$S;23|) (SEQ G190 (COND ((NULL (COND ((NULL |x|) (QUOTE NIL)) ((QUOTE T) (QUOTE T)))) (GO G191))) (SEQ (LETT |s| (STRCONC |s| (SPADCALL (QCAR |x|) (QREFELT |$| 49))) |ILIST;latex;$S;23|) (LETT |x| (QCDR |x|) |ILIST;latex;$S;23|) (EXIT (COND ((NULL (NULL |x|)) (LETT |s| (STRCONC |s| ", ") |ILIST;latex;$S;23|))))) NIL (GO G190) G191 (EXIT NIL)) (EXIT (STRCONC |s| " \\right]")))))) - -(DEFUN |ILIST;member?;S$B;24| (|s| |x| |$|) (PROG (#1=#:G102052) (RETURN (SEQ (EXIT (SEQ (SEQ G190 (COND ((NULL (COND ((NULL |x|) (QUOTE NIL)) ((QUOTE T) (QUOTE T)))) (GO G191))) (SEQ (EXIT (COND ((SPADCALL |s| (QCAR |x|) (QREFELT |$| 46)) (PROGN (LETT #1# (QUOTE T) |ILIST;member?;S$B;24|) (GO #1#))) ((QUOTE T) (LETT |x| (QCDR |x|) |ILIST;member?;S$B;24|))))) NIL (GO G190) G191 (EXIT NIL)) (EXIT (QUOTE NIL)))) #1# (EXIT #1#))))) - -(DEFUN |ILIST;concat!;3$;25| (|x| |y| |$|) (PROG (|z|) (RETURN (SEQ (COND ((NULL |x|) (COND ((NULL |y|) |x|) ((QUOTE T) (SEQ (PUSH (SPADCALL |y| (QREFELT |$| 13)) |x|) (QRPLACD |x| (SPADCALL |y| (QREFELT |$| 18))) (EXIT |x|))))) ((QUOTE T) (SEQ (LETT |z| |x| |ILIST;concat!;3$;25|) (SEQ G190 (COND ((NULL (COND ((NULL (QCDR |z|)) (QUOTE NIL)) ((QUOTE T) (QUOTE T)))) (GO G191))) (SEQ (EXIT (LETT |z| (QCDR |z|) |ILIST;concat!;3$;25|))) NIL (GO G190) G191 (EXIT NIL)) (QRPLACD |z| |y|) (EXIT |x|)))))))) - -(DEFUN |ILIST;removeDuplicates!;2$;26| (|l| |$|) (PROG (|f| |p| |pr| |pp|) (RETURN (SEQ (LETT |p| |l| |ILIST;removeDuplicates!;2$;26|) (SEQ G190 (COND ((NULL (COND ((NULL |p|) (QUOTE NIL)) ((QUOTE T) (QUOTE T)))) (GO G191))) (SEQ (LETT |pp| |p| |ILIST;removeDuplicates!;2$;26|) (LETT |f| (QCAR |p|) |ILIST;removeDuplicates!;2$;26|) (LETT |p| (QCDR |p|) |ILIST;removeDuplicates!;2$;26|) (EXIT (SEQ G190 (COND ((NULL (COND ((NULL (LETT |pr| (QCDR |pp|) |ILIST;removeDuplicates!;2$;26|)) (QUOTE NIL)) ((QUOTE T) (QUOTE T)))) (GO G191))) (SEQ (EXIT (COND ((SPADCALL (QCAR |pr|) |f| (QREFELT |$| 46)) (QRPLACD |pp| (QCDR |pr|))) ((QUOTE T) (LETT |pp| |pr| |ILIST;removeDuplicates!;2$;26|))))) NIL (GO G190) G191 (EXIT NIL)))) NIL (GO G190) G191 (EXIT NIL)) (EXIT |l|))))) - -(DEFUN |ILIST;sort!;M2$;27| (|f| |l| |$|) (|ILIST;mergeSort| |f| |l| (SPADCALL |l| (QREFELT |$| 9)) |$|)) - -(DEFUN |ILIST;merge!;M3$;28| (|f| |p| |q| |$|) (PROG (|r| |t|) (RETURN (SEQ (COND ((NULL |p|) |q|) ((NULL |q|) |p|) ((EQ |p| |q|) (|error| "cannot merge a list into itself")) ((QUOTE T) (SEQ (COND ((SPADCALL (QCAR |p|) (QCAR |q|) |f|) (SEQ (LETT |r| (LETT |t| |p| |ILIST;merge!;M3$;28|) |ILIST;merge!;M3$;28|) (EXIT (LETT |p| (QCDR |p|) |ILIST;merge!;M3$;28|)))) ((QUOTE T) (SEQ (LETT |r| (LETT |t| |q| |ILIST;merge!;M3$;28|) |ILIST;merge!;M3$;28|) (EXIT (LETT |q| (QCDR |q|) |ILIST;merge!;M3$;28|))))) (SEQ G190 (COND ((NULL (COND ((OR (NULL |p|) (NULL |q|)) (QUOTE NIL)) ((QUOTE T) (QUOTE T)))) (GO G191))) (SEQ (EXIT (COND ((SPADCALL (QCAR |p|) (QCAR |q|) |f|) (SEQ (QRPLACD |t| |p|) (LETT |t| |p| |ILIST;merge!;M3$;28|) (EXIT (LETT |p| (QCDR |p|) |ILIST;merge!;M3$;28|)))) ((QUOTE T) (SEQ (QRPLACD |t| |q|) (LETT |t| |q| |ILIST;merge!;M3$;28|) (EXIT (LETT |q| (QCDR |q|) |ILIST;merge!;M3$;28|))))))) NIL (GO G190) G191 (EXIT NIL)) (QRPLACD |t| (COND ((NULL |p|) |q|) ((QUOTE T) |p|))) (EXIT |r|)))))))) - -(DEFUN |ILIST;split!;$I$;29| (|p| |n| |$|) (PROG (#1=#:G102085 |q|) (RETURN (SEQ (COND ((|<| |n| 1) (|error| "index out of range")) ((QUOTE T) (SEQ (LETT |p| (SPADCALL |p| (PROG1 (LETT #1# (|-| |n| 1) |ILIST;split!;$I$;29|) (|check-subtype| (|>=| #1# 0) (QUOTE (|NonNegativeInteger|)) #1#)) (QREFELT |$| 32)) |ILIST;split!;$I$;29|) (LETT |q| (QCDR |p|) |ILIST;split!;$I$;29|) (QRPLACD |p| NIL) (EXIT |q|)))))))) - -(DEFUN |ILIST;mergeSort| (|f| |p| |n| |$|) (PROG (#1=#:G102089 |l| |q|) (RETURN (SEQ (COND ((EQL |n| 2) (COND ((SPADCALL (SPADCALL (SPADCALL |p| (QREFELT |$| 18)) (QREFELT |$| 13)) (SPADCALL |p| (QREFELT |$| 13)) |f|) (LETT |p| (SPADCALL |p| (QREFELT |$| 28)) |ILIST;mergeSort|))))) (EXIT (COND ((|<| |n| 3) |p|) ((QUOTE T) (SEQ (LETT |l| (PROG1 (LETT #1# (QUOTIENT2 |n| 2) |ILIST;mergeSort|) (|check-subtype| (|>=| #1# 0) (QUOTE (|NonNegativeInteger|)) #1#)) |ILIST;mergeSort|) (LETT |q| (SPADCALL |p| |l| (QREFELT |$| 57)) |ILIST;mergeSort|) (LETT |p| (|ILIST;mergeSort| |f| |p| |l| |$|) |ILIST;mergeSort|) (LETT |q| (|ILIST;mergeSort| |f| |q| (|-| |n| |l|) |$|) |ILIST;mergeSort|) (EXIT (SPADCALL |f| |p| |q| (QREFELT |$| 56))))))))))) - -(DEFUN |IndexedList| (|&REST| #1=#:G102103 |&AUX| #2=#:G102101) (DSETQ #2# #1#) (PROG NIL (RETURN (PROG (#3=#:G102102) (RETURN (COND ((LETT #3# (|lassocShiftWithFunction| (|devaluateList| #2#) (HGET |$ConstructorCache| (QUOTE |IndexedList|)) (QUOTE |domainEqualList|)) |IndexedList|) (|CDRwithIncrement| #3#)) ((QUOTE T) (|UNWIND-PROTECT| (PROG1 (APPLY (|function| |IndexedList;|) #2#) (LETT #3# T |IndexedList|)) (COND ((NOT #3#) (HREM |$ConstructorCache| (QUOTE |IndexedList|)))))))))))) - -(DEFUN |IndexedList;| (|#1| |#2|) (PROG (|DV$1| |DV$2| |dv$| |$| #1=#:G102100 |pv$|) (RETURN (PROGN (LETT |DV$1| (|devaluate| |#1|) . #2=(|IndexedList|)) (LETT |DV$2| (|devaluate| |#2|) . #2#) (LETT |dv$| (LIST (QUOTE |IndexedList|) |DV$1| |DV$2|) . #2#) (LETT |$| (GETREFV 71) . #2#) (QSETREFV |$| 0 |dv$|) (QSETREFV |$| 3 (LETT |pv$| (|buildPredVector| 0 0 (LIST (|HasCategory| |#1| (QUOTE (|SetCategory|))) (|HasCategory| |#1| (QUOTE (|ConvertibleTo| (|InputForm|)))) (LETT #1# (|HasCategory| |#1| (QUOTE (|OrderedSet|))) . #2#) (OR #1# (|HasCategory| |#1| (QUOTE (|SetCategory|)))) (|HasCategory| (|Integer|) (QUOTE (|OrderedSet|))) (AND (|HasCategory| |#1| (LIST (QUOTE |Evalable|) (|devaluate| |#1|))) (|HasCategory| |#1| (QUOTE (|SetCategory|)))) (OR (AND (|HasCategory| |#1| (LIST (QUOTE |Evalable|) (|devaluate| |#1|))) #1#) (AND (|HasCategory| |#1| (LIST (QUOTE |Evalable|) (|devaluate| |#1|))) (|HasCategory| |#1| (QUOTE (|SetCategory|))))))) . #2#)) (|haddProp| |$ConstructorCache| (QUOTE |IndexedList|) (LIST |DV$1| |DV$2|) (CONS 1 |$|)) (|stuffDomainSlots| |$|) (QSETREFV |$| 6 |#1|) (QSETREFV |$| 7 |#2|) (COND ((|testBitVector| |pv$| 1) (PROGN (QSETREFV |$| 45 (CONS (|dispatchFunction| |ILIST;coerce;$Of;21|) |$|)) (QSETREFV |$| 47 (CONS (|dispatchFunction| |ILIST;=;2$B;22|) |$|)) (QSETREFV |$| 50 (CONS (|dispatchFunction| |ILIST;latex;$S;23|) |$|)) (QSETREFV |$| 51 (CONS (|dispatchFunction| |ILIST;member?;S$B;24|) |$|))))) (COND ((|testBitVector| |pv$| 1) (QSETREFV |$| 53 (CONS (|dispatchFunction| |ILIST;removeDuplicates!;2$;26|) |$|)))) |$|)))) - -(MAKEPROP (QUOTE |IndexedList|) (QUOTE |infovec|) (LIST (QUOTE #(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|) (|NonNegativeInteger|) |ILIST;#;$Nni;1| |ILIST;concat;S2$;2| (|Boolean|) |ILIST;eq?;2$B;3| |ILIST;first;$S;4| (QUOTE "first") |ILIST;elt;$firstS;5| |ILIST;empty;$;6| |ILIST;empty?;$B;7| |ILIST;rest;2$;8| (QUOTE "rest") |ILIST;elt;$rest$;9| |ILIST;setfirst!;$2S;10| |ILIST;setelt;$first2S;11| |ILIST;setrest!;3$;12| |ILIST;setelt;$rest2$;13| (|List| 6) |ILIST;construct;L$;14| |ILIST;parts;$L;15| |ILIST;reverse!;2$;16| |ILIST;reverse;2$;17| (|Integer|) |ILIST;minIndex;$I;18| |ILIST;rest;$Nni$;19| (0 . |cyclic?|) |ILIST;copy;2$;20| (5 . |cycleEntry|) (|OutputForm|) (10 . |coerce|) (|List| |$|) (15 . |bracket|) (|List| 36) (20 . |list|) (25 . |commaSeparate|) (30 . |overbar|) (35 . |concat!|) (41 . |coerce|) (46 . |=|) (52 . |=|) (|String|) (58 . |latex|) (63 . |latex|) (68 . |member?|) |ILIST;concat!;3$;25| (74 . |removeDuplicates!|) (|Mapping| 11 6 6) |ILIST;sort!;M2$;27| |ILIST;merge!;M3$;28| |ILIST;split!;$I$;29| (|Mapping| 6 6 6) (|Equation| 6) (|List| 59) (|Mapping| 11 6) (|Void|) (|UniversalSegment| 30) (QUOTE "last") (QUOTE "value") (|Mapping| 6 6) (|InputForm|) (|SingleInteger|) (|List| 30) (|Union| 6 (QUOTE "failed")))) (QUOTE #(|~=| 79 |value| 85 |third| 90 |tail| 95 |swap!| 100 |split!| 107 |sorted?| 113 |sort!| 124 |sort| 135 |size?| 146 |setvalue!| 152 |setrest!| 158 |setlast!| 164 |setfirst!| 170 |setelt| 176 |setchildren!| 218 |select!| 224 |select| 230 |second| 236 |sample| 241 |reverse!| 245 |reverse| 250 |rest| 255 |removeDuplicates!| 266 |removeDuplicates| 271 |remove!| 276 |remove| 288 |reduce| 300 |qsetelt!| 321 |qelt| 328 |possiblyInfinite?| 334 |position| 339 |parts| 358 |nodes| 363 |node?| 368 |new| 374 |more?| 380 |minIndex| 386 |min| 391 |merge!| 397 |merge| 410 |members| 423 |member?| 428 |maxIndex| 434 |max| 439 |map!| 445 |map| 451 |list| 464 |less?| 469 |leaves| 475 |leaf?| 480 |latex| 485 |last| 490 |insert!| 501 |insert| 515 |indices| 529 |index?| 534 |hash| 540 |first| 545 |find| 556 |fill!| 562 |explicitlyFinite?| 568 |every?| 573 |eval| 579 |eq?| 605 |entry?| 611 |entries| 617 |empty?| 622 |empty| 627 |elt| 631 |distance| 674 |delete!| 680 |delete| 692 |cyclic?| 704 |cycleTail| 709 |cycleSplit!| 714 |cycleLength| 719 |cycleEntry| 724 |count| 729 |copyInto!| 741 |copy| 748 |convert| 753 |construct| 758 |concat!| 763 |concat| 775 |coerce| 798 |children| 803 |child?| 808 |any?| 814 |>=| 820 |>| 826 |=| 832 |<=| 838 |<| 844 |#| 850)) (QUOTE ((|shallowlyMutable| . 0) (|finiteAggregate| . 0))) (CONS (|makeByteWordVec2| 7 (QUOTE (0 0 0 0 0 0 0 0 0 0 3 0 0 7 4 0 0 7 1 2 4))) (CONS (QUOTE #(|ListAggregate&| |StreamAggregate&| |ExtensibleLinearAggregate&| |FiniteLinearAggregate&| |UnaryRecursiveAggregate&| |LinearAggregate&| |RecursiveAggregate&| |IndexedAggregate&| |Collection&| |HomogeneousAggregate&| |OrderedSet&| |Aggregate&| |EltableAggregate&| |Evalable&| |SetCategory&| NIL NIL |InnerEvalable&| NIL NIL |BasicType&|)) (CONS (QUOTE #((|ListAggregate| 6) (|StreamAggregate| 6) (|ExtensibleLinearAggregate| 6) (|FiniteLinearAggregate| 6) (|UnaryRecursiveAggregate| 6) (|LinearAggregate| 6) (|RecursiveAggregate| 6) (|IndexedAggregate| 30 6) (|Collection| 6) (|HomogeneousAggregate| 6) (|OrderedSet|) (|Aggregate|) (|EltableAggregate| 30 6) (|Evalable| 6) (|SetCategory|) (|Type|) (|Eltable| 30 6) (|InnerEvalable| 6 6) (|CoercibleTo| 36) (|ConvertibleTo| 67) (|BasicType|))) (|makeByteWordVec2| 70 (QUOTE (1 0 11 0 33 1 0 0 0 35 1 6 36 0 37 1 36 0 38 39 1 40 0 36 41 1 36 0 38 42 1 36 0 0 43 2 40 0 0 36 44 1 0 36 0 45 2 6 11 0 0 46 2 0 11 0 0 47 1 6 48 0 49 1 0 48 0 50 2 0 11 6 0 51 1 0 0 0 53 2 1 11 0 0 1 1 0 6 0 1 1 0 6 0 1 1 0 0 0 1 3 0 62 0 30 30 1 2 0 0 0 30 57 1 3 11 0 1 2 0 11 54 0 1 1 3 0 0 1 2 0 0 54 0 55 1 3 0 0 1 2 0 0 54 0 1 2 0 11 0 8 1 2 0 6 0 6 1 2 0 0 0 0 23 2 0 6 0 6 1 2 0 6 0 6 21 3 0 6 0 30 6 1 3 0 6 0 63 6 1 3 0 6 0 64 6 1 3 0 0 0 19 0 24 3 0 6 0 14 6 22 3 0 6 0 65 6 1 2 0 0 0 38 1 2 0 0 61 0 1 2 0 0 61 0 1 1 0 6 0 1 0 0 0 1 1 0 0 0 28 1 0 0 0 29 2 0 0 0 8 32 1 0 0 0 18 1 1 0 0 53 1 1 0 0 1 2 1 0 6 0 1 2 0 0 61 0 1 2 1 0 6 0 1 2 0 0 61 0 1 4 1 6 58 0 6 6 1 2 0 6 58 0 1 3 0 6 58 0 6 1 3 0 6 0 30 6 1 2 0 6 0 30 1 1 0 11 0 1 2 1 30 6 0 1 3 1 30 6 0 30 1 2 0 30 61 0 1 1 0 25 0 27 1 0 38 0 1 2 1 11 0 0 1 2 0 0 8 6 1 2 0 11 0 8 1 1 5 30 0 31 2 3 0 0 0 1 2 3 0 0 0 1 3 0 0 54 0 0 56 2 3 0 0 0 1 3 0 0 54 0 0 1 1 0 25 0 1 2 1 11 6 0 51 1 5 30 0 1 2 3 0 0 0 1 2 0 0 66 0 1 3 0 0 58 0 0 1 2 0 0 66 0 1 1 0 0 6 1 2 0 11 0 8 1 1 0 25 0 1 1 0 11 0 1 1 1 48 0 50 2 0 0 0 8 1 1 0 6 0 1 3 0 0 6 0 30 1 3 0 0 0 0 30 1 3 0 0 0 0 30 1 3 0 0 6 0 30 1 1 0 69 0 1 2 0 11 30 0 1 1 1 68 0 1 2 0 0 0 8 1 1 0 6 0 13 2 0 70 61 0 1 2 0 0 0 6 1 1 0 11 0 1 2 0 11 61 0 1 3 6 0 0 6 6 1 3 6 0 0 25 25 1 2 6 0 0 59 1 2 6 0 0 60 1 2 0 11 0 0 12 2 1 11 6 0 1 1 0 25 0 1 1 0 11 0 17 0 0 0 16 2 0 6 0 30 1 3 0 6 0 30 6 1 2 0 0 0 63 1 2 0 6 0 64 1 2 0 0 0 19 20 2 0 6 0 14 15 2 0 6 0 65 1 2 0 30 0 0 1 2 0 0 0 63 1 2 0 0 0 30 1 2 0 0 0 63 1 2 0 0 0 30 1 1 0 11 0 33 1 0 0 0 1 1 0 0 0 1 1 0 8 0 1 1 0 0 0 35 2 1 8 6 0 1 2 0 8 61 0 1 3 0 0 0 0 30 1 1 0 0 0 34 1 2 67 0 1 1 0 0 25 26 2 0 0 0 0 52 2 0 0 0 6 1 1 0 0 38 1 2 0 0 0 6 1 2 0 0 6 0 10 2 0 0 0 0 1 1 1 36 0 45 1 0 38 0 1 2 1 11 0 0 1 2 0 11 61 0 1 2 3 11 0 0 1 2 3 11 0 0 1 2 1 11 0 0 47 2 3 11 0 0 1 2 3 11 0 0 1 1 0 8 0 9)))))) (QUOTE |lookupComplete|))) -@ -\section{domain LIST List} -<>= --- list.spad.pamphlet List.input -)spool List.output -)set message test on -)set message auto off -)clear all ---S 1 of 34 -[2, 4, 5, 6] ---R ---R ---R (1) [2,4,5,6] ---R Type: List PositiveInteger ---E 1 - ---S 2 of 34 -[1] ---R ---R ---R (2) [1] ---R Type: List PositiveInteger ---E 2 - ---S 3 of 34 -list(1) ---R ---R ---R (3) [1] ---R Type: List PositiveInteger ---E 3 - ---S 4 of 34 -append([1,2,3],[5,6,7]) ---R ---R ---R (4) [1,2,3,5,6,7] ---R Type: List PositiveInteger ---E 4 - ---S 5 of 34 -cons(10,[9,8,7]) ---R ---R ---R (5) [10,9,8,7] ---R Type: List PositiveInteger ---E 5 - ---S 6 of 34 -empty? [x+1] ---R ---R ---R (6) false ---R Type: Boolean ---E 6 - ---S 7 of 34 -([] = nil)@Boolean ---R ---R ---R (7) true ---R Type: Boolean ---E 7 - ---S 8 of 34 -k := [4,3,7,3,8,5,9,2] ---R ---R ---R (8) [4,3,7,3,8,5,9,2] ---R Type: List PositiveInteger ---E 8 - ---S 9 of 34 -first k ---R ---R ---R (9) 4 ---R Type: PositiveInteger ---E 9 - ---S 10 of 34 -k.first ---R ---R ---R (10) 4 ---R Type: PositiveInteger ---E 10 - ---S 11 of 34 -k.1 ---R ---R ---R (11) 4 ---R Type: PositiveInteger ---E 11 - ---S 12 of 34 -k(1) ---R ---R ---R (12) 4 ---R Type: PositiveInteger ---E 12 - ---S 13 of 34 -n := #k ---R ---R ---R (13) 8 ---R Type: PositiveInteger ---E 13 - ---S 14 of 34 -last k ---R ---R ---R (14) 2 ---R Type: PositiveInteger ---E 14 - ---S 15 of 34 -k.last ---R ---R ---R (15) 2 ---R Type: PositiveInteger ---E 15 - ---S 16 of 34 -k.(#k) ---R ---R ---R (16) 2 ---R Type: PositiveInteger ---E 16 - ---S 17 of 34 -k := [4,3,7,3,8,5,9,2] ---R ---R ---R (17) [4,3,7,3,8,5,9,2] ---R Type: List PositiveInteger ---E 17 - ---S 18 of 34 -k.1 := 999 ---R ---R ---R (18) 999 ---R Type: PositiveInteger ---E 18 - ---S 19 of 34 -k ---R ---R ---R (19) [999,3,7,3,8,5,9,2] ---R Type: List PositiveInteger ---E 19 - ---S 20 of 34 -k := [1,2] ---R ---R ---R (20) [1,2] ---R Type: List PositiveInteger ---E 20 - ---S 21 of 34 -m := cons(0,k) ---R ---R ---R (21) [0,1,2] ---R Type: List Integer ---E 21 - ---S 22 of 34 -m.2 := 99 ---R ---R ---R (22) 99 ---R Type: PositiveInteger ---E 22 - ---S 23 of 34 -m ---R ---R ---R (23) [0,99,2] ---R Type: List Integer ---E 23 - ---S 24 of 34 -k ---R ---R ---R (24) [99,2] ---R Type: List PositiveInteger ---E 24 - ---S 25 of 34 -k := [1,2,3] ---R ---R ---R (25) [1,2,3] ---R Type: List PositiveInteger ---E 25 - ---S 26 of 34 -rest k ---R ---R ---R (26) [2,3] ---R Type: List PositiveInteger ---E 26 - ---S 27 of 34 -removeDuplicates [4,3,4,3,5,3,4] ---R ---R ---R (27) [4,3,5] ---R Type: List PositiveInteger ---E 27 - ---S 28 of 34 -reverse [1,2,3,4,5,6] ---R ---R ---R (28) [6,5,4,3,2,1] ---R Type: List PositiveInteger ---E 28 - ---S 29 of 34 -member?(1/2,[3/4,5/6,1/2]) ---R ---R ---R (29) true ---R Type: Boolean ---E 29 - ---S 30 of 34 -member?(1/12,[3/4,5/6,1/2]) ---R ---R ---R (30) false ---R Type: Boolean ---E 30 - ---S 31 of 34 -reverse(rest(reverse(k))) ---R ---R ---R (31) [1,2] ---R Type: List PositiveInteger ---E 31 - ---S 32 of 34 -[1..3,10,20..23] ---R ---R ---R (32) [1..3,10..10,20..23] ---R Type: List Segment PositiveInteger ---E 32 - ---S 33 of 34 -expand [1..3,10,20..23] ---R ---R ---R (33) [1,2,3,10,20,21,22,23] ---R Type: List Integer ---E 33 - ---S 34 of 34 -expand [1..] ---R ---R ---R (34) [1,2,3,4,5,6,7,8,9,10,...] ---R Type: Stream Integer ---E 34 -)spool -)lisp (bye) -@ -<>= -==================================================================== -List examples -==================================================================== - -A list is a finite collection of elements in a specified order that -can contain duplicates. A list is a convenient structure to work with -because it is easy to add or remove elements and the length need not -be constant. There are many different kinds of lists in Axiom, but -the default types (and those used most often) are created by the List -constructor. For example, there are objects of type List Integer, -List Float and List Polynomial Fraction Integer. Indeed, you can even -have List List List Boolean (that is, lists of lists of lists of -Boolean values). You can have lists of any type of Axiom object. - -==================================================================== -Creating Lists -==================================================================== - -The easiest way to create a list with, for example, the elements -2, 4, 5, 6 is to enclose the elements with square brackets and -separate the elements with commas. - -The spaces after the commas are optional, but they do improve the -readability. - - [2, 4, 5, 6] - [2,4,5,6] - Type: List PositiveInteger - -To create a list with the single element 1, you can use either [1] or -the operation list. - - [1] - [1] - Type: List PositiveInteger - - list(1) - [1] - Type: List PositiveInteger - -Once created, two lists k and m can be concatenated by issuing -append(k,m). append does not physically join the lists, but rather -produces a new list with the elements coming from the two arguments. - - append([1,2,3],[5,6,7]) - [1,2,3,5,6,7] - Type: List PositiveInteger - -Use cons to append an element onto the front of a list. - - cons(10,[9,8,7]) - [10,9,8,7] - Type: List PositiveInteger - -==================================================================== -Accessing List Elements -==================================================================== - -To determine whether a list has any elements, use the operation empty?. - - empty? [x+1] - false - Type: Boolean - -Alternatively, equality with the list constant nil can be tested. - - ([] = nil)@Boolean - true - Type: Boolean - -We'll use this in some of the following examples. - - k := [4,3,7,3,8,5,9,2] - [4,3,7,3,8,5,9,2] - Type: List PositiveInteger - -Each of the next four expressions extracts the first element of k. - - first k - 4 - Type: PositiveInteger - - k.first - 4 - Type: PositiveInteger - - k.1 - 4 - Type: PositiveInteger - - k(1) - 4 - Type: PositiveInteger - -The last two forms generalize to k.i and k(i), respectively, where -1 <= i <= n and n equals the length of k. - -This length is calculated by #. - - n := #k - 8 - Type: PositiveInteger - -Performing an operation such as k.i is sometimes referred to as -indexing into k or elting into k. The latter phrase comes about -because the name of the operation that extracts elements is called -elt. That is, k.3 is just alternative syntax for elt(k,3). It is -important to remember that list indices begin with 1. If we issue -k := [1,3,2,9,5] then k.4 returns 9. It is an error to use an index -that is not in the range from 1 to the length of the list. - -The last element of a list is extracted by any of the following three -expressions. - - last k - 2 - Type: PositiveInteger - - k.last - 2 - Type: PositiveInteger - -This form computes the index of the last element and then extracts the -element from the list. - - k.(#k) - 2 - Type: PositiveInteger - -==================================================================== -Changing List Elements -==================================================================== - -We'll use this in some of the following examples. - - k := [4,3,7,3,8,5,9,2] - [4,3,7,3,8,5,9,2] - Type: List PositiveInteger - -List elements are reset by using the k.i form on the left-hand side of -an assignment. This expression resets the first element of k to 999. - - k.1 := 999 - 999 - Type: PositiveInteger - -As with indexing into a list, it is an error to use an index that is -not within the proper bounds. Here you see that k was modified. - - k - [999,3,7,3,8,5,9,2] - Type: List PositiveInteger - -The operation that performs the assignment of an element to a -particular position in a list is called setelt. This operation is -destructive in that it changes the list. In the above example, the -assignment returned the value 999 and k was modified. For this -reason, lists are called mutable objects: it is possible to change -part of a list (mutate it) rather than always returning a new list -reflecting the intended modifications. - -Moreover, since lists can share structure, changes to one list can -sometimes affect others. - - k := [1,2] - [1,2] - Type: List PositiveInteger - - m := cons(0,k) - [0,1,2] - Type: List Integer - -Change the second element of m. - - m.2 := 99 - 99 - Type: PositiveInteger - -See, m was altered. - - m - [0,99,2] - Type: List Integer - -But what about k? It changed too! - - k - [99,2] - Type: List PositiveInteger - -==================================================================== -Other Functions -==================================================================== - -An operation that is used frequently in list processing is that -which returns all elements in a list after the first element. - - k := [1,2,3] - [1,2,3] - Type: List PositiveInteger - -Use the rest operation to do this. - - rest k - [2,3] - Type: List PositiveInteger - -To remove duplicate elements in a list k, use removeDuplicates. - - removeDuplicates [4,3,4,3,5,3,4] - [4,3,5] - Type: List PositiveInteger - -To get a list with elements in the order opposite to those in a list -k, use reverse. - - reverse [1,2,3,4,5,6] - [6,5,4,3,2,1] - Type: List PositiveInteger - -To test whether an element is in a list, use member?: member?(a,k) -returns true or false depending on whether a is in k or not. - - member?(1/2,[3/4,5/6,1/2]) - true - Type: Boolean - - member?(1/12,[3/4,5/6,1/2]) - false - Type: Boolean - -We can get a list containing all but the last of the elements in a -given non-empty list k. - - reverse(rest(reverse(k))) - [1,2] - Type: List PositiveInteger - -==================================================================== -Dot, Dot -==================================================================== - -Certain lists are used so often that Axiom provides an easy way of -constructing them. If n and m are integers, then expand [n..m] -creates a list containing n, n+1, ... m. If n > m then the list is -empty. It is actually permissible to leave off the m in the dot-dot -construction (see below). - -The dot-dot notation can be used more than once in a list construction -and with specific elements being given. Items separated by dots are -called segments. - - [1..3,10,20..23] - [1..3,10..10,20..23] - Type: List Segment PositiveInteger - -Segments can be expanded into the range of items between the endpoints -by using expand. - - expand [1..3,10,20..23] - [1,2,3,10,20,21,22,23] - Type: List Integer - -What happens if we leave off a number on the right-hand side of ..? - - expand [1..] - [1,2,3,4,5,6,7,8,9,10,...] - Type: Stream Integer - -What is created in this case is a Stream which is a generalization of -a list. - -See Also: -o )help Stream -o )show List -o $AXIOM/doc/src/algebra/list.spad.dvi - -@ -<>= -)abbrev domain LIST List -++ Author: Michael Monagan -++ Date Created: Sep 1987 -++ Change History: -++ Basic Operations: -++ \#, append, concat, concat!, cons, construct, copy, elt, elt, -++ empty, empty?, eq?, first, member?, merge!, mergeSort, minIndex, -++ nil, null, parts, removeDuplicates!, rest, rest, reverse, -++ reverse!, setDifference, setIntersection, setUnion, setelt, -++ setfirst!, setrest!, sort!, split! -++ Related Constructors: ListFunctions2, ListFunctions3, ListToMap -++ Also See: IndexList, ListAggregate -++ AMS Classification: -++ Keywords: list, index, aggregate, lisp -++ Description: -++ \spadtype{List} implements singly-linked lists that are -++ addressable by indices; the index of the first element -++ is 1. In addition to the operations provided by -++ \spadtype{IndexedList}, this constructor provides some -++ LISP-like functions such as \spadfun{null} and \spadfun{cons}. -List(S:Type): Exports == Implementation where - LISTMININDEX ==> 1 -- this is the minimum list index - - Exports ==> ListAggregate S with - nil : () -> % - ++ nil() returns the empty list. - null : % -> Boolean - ++ null(u) tests if list \spad{u} is the - ++ empty list. - cons : (S, %) -> % - ++ cons(element,u) appends \spad{element} onto the front - ++ of list \spad{u} and returns the new list. This new list - ++ and the old one will share some structure. - append : (%, %) -> % - ++ append(u1,u2) appends the elements of list \spad{u1} - ++ onto the front of list \spad{u2}. This new list - ++ and \spad{u2} will share some structure. - if S has SetCategory then - setUnion : (%, %) -> % - ++ setUnion(u1,u2) appends the two lists u1 and u2, then - ++ removes all duplicates. The order of elements in the - ++ resulting list is unspecified. - setIntersection : (%, %) -> % - ++ setIntersection(u1,u2) returns a list of the elements - ++ that lists \spad{u1} and \spad{u2} have in common. - ++ The order of elements in the resulting list is unspecified. - setDifference : (%, %) -> % - ++ setDifference(u1,u2) returns a list of the elements - ++ of \spad{u1} that are not also in \spad{u2}. - ++ The order of elements in the resulting list is unspecified. - if S has OpenMath then OpenMath - - Implementation ==> - IndexedList(S, LISTMININDEX) add - nil() == NIL$Lisp - null l == NULL(l)$Lisp - cons(s, l) == CONS(s, l)$Lisp - append(l:%, t:%) == APPEND(l, t)$Lisp - - if S has OpenMath then - writeOMList(dev: OpenMathDevice, x: %): Void == - OMputApp(dev) - OMputSymbol(dev, "list1", "list") - -- The following didn't compile because the compiler isn't - -- convinced that `xval' is a S. Duhhh! MCD. - --for xval in x repeat - -- OMwrite(dev, xval, false) - while not null x repeat - OMwrite(dev,first x,false) - x := rest x - OMputEndApp(dev) - - OMwrite(x: %): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML) - OMputObject(dev) - writeOMList(dev, x) - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(x: %, wholeObj: Boolean): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML) - if wholeObj then - OMputObject(dev) - writeOMList(dev, x) - if wholeObj then - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(dev: OpenMathDevice, x: %): Void == - OMputObject(dev) - writeOMList(dev, x) - OMputEndObject(dev) - - OMwrite(dev: OpenMathDevice, x: %, wholeObj: Boolean): Void == - if wholeObj then - OMputObject(dev) - writeOMList(dev, x) - if wholeObj then - OMputEndObject(dev) - - if S has SetCategory then - setUnion(l1:%,l2:%) == removeDuplicates concat(l1,l2) - - setIntersection(l1:%,l2:%) == - u :% := empty() - l1 := removeDuplicates l1 - while not empty? l1 repeat - if member?(first l1,l2) then u := cons(first l1,u) - l1 := rest l1 - u - - setDifference(l1:%,l2:%) == - l1 := removeDuplicates l1 - lu:% := empty() - while not empty? l1 repeat - l11:=l1.1 - if not member?(l11,l2) then lu := concat(l11,lu) - l1 := rest l1 - lu - - if S has ConvertibleTo InputForm then - convert(x:%):InputForm == - convert concat(convert("construct"::Symbol)@InputForm, - [convert a for a in (x pretend List S)]$List(InputForm)) - -@ -\section{LIST.lsp BOOTSTRAP} -{\bf LIST} depends on a chain of -files. We need to break this cycle to build the algebra. So we keep a -cached copy of the translated {\bf LIST} category which we can write -into the {\bf MID} directory. We compile the lisp code and copy the -{\bf LIST.o} file to the {\bf OUT} directory. This is eventually -forcibly replaced by a recompiled version. - -Note that this code is not included in the generated catdef.spad file. - -<>= - -(|/VERSIONCHECK| 2) - -(PUT (QUOTE |LIST;nil;$;1|) (QUOTE |SPADreplace|) (QUOTE (XLAM NIL NIL))) - -(DEFUN |LIST;nil;$;1| (|$|) NIL) - -(PUT (QUOTE |LIST;null;$B;2|) (QUOTE |SPADreplace|) (QUOTE NULL)) - -(DEFUN |LIST;null;$B;2| (|l| |$|) (NULL |l|)) - -(PUT (QUOTE |LIST;cons;S2$;3|) (QUOTE |SPADreplace|) (QUOTE CONS)) - -(DEFUN |LIST;cons;S2$;3| (|s| |l| |$|) (CONS |s| |l|)) - -(PUT (QUOTE |LIST;append;3$;4|) (QUOTE |SPADreplace|) (QUOTE APPEND)) - -(DEFUN |LIST;append;3$;4| (|l| |t| |$|) (APPEND |l| |t|)) - -(DEFUN |LIST;writeOMList| (|dev| |x| |$|) (SEQ (SPADCALL |dev| (QREFELT |$| 14)) (SPADCALL |dev| "list1" "list" (QREFELT |$| 16)) (SEQ G190 (COND ((NULL (COND ((NULL |x|) (QUOTE NIL)) ((QUOTE T) (QUOTE T)))) (GO G191))) (SEQ (SPADCALL |dev| (|SPADfirst| |x|) (QUOTE NIL) (QREFELT |$| 17)) (EXIT (LETT |x| (CDR |x|) |LIST;writeOMList|))) NIL (GO G190) G191 (EXIT NIL)) (EXIT (SPADCALL |dev| (QREFELT |$| 18))))) - -(DEFUN |LIST;OMwrite;$S;6| (|x| |$|) (PROG (|sp| |dev| |s|) (RETURN (SEQ (LETT |s| "" |LIST;OMwrite;$S;6|) (LETT |sp| (|OM-STRINGTOSTRINGPTR| |s|) |LIST;OMwrite;$S;6|) (LETT |dev| (SPADCALL |sp| (SPADCALL (QREFELT |$| 20)) (QREFELT |$| 21)) |LIST;OMwrite;$S;6|) (SPADCALL |dev| (QREFELT |$| 22)) (|LIST;writeOMList| |dev| |x| |$|) (SPADCALL |dev| (QREFELT |$| 23)) (SPADCALL |dev| (QREFELT |$| 24)) (LETT |s| (|OM-STRINGPTRTOSTRING| |sp|) |LIST;OMwrite;$S;6|) (EXIT |s|))))) - -(DEFUN |LIST;OMwrite;$BS;7| (|x| |wholeObj| |$|) (PROG (|sp| |dev| |s|) (RETURN (SEQ (LETT |s| "" |LIST;OMwrite;$BS;7|) (LETT |sp| (|OM-STRINGTOSTRINGPTR| |s|) |LIST;OMwrite;$BS;7|) (LETT |dev| (SPADCALL |sp| (SPADCALL (QREFELT |$| 20)) (QREFELT |$| 21)) |LIST;OMwrite;$BS;7|) (COND (|wholeObj| (SPADCALL |dev| (QREFELT |$| 22)))) (|LIST;writeOMList| |dev| |x| |$|) (COND (|wholeObj| (SPADCALL |dev| (QREFELT |$| 23)))) (SPADCALL |dev| (QREFELT |$| 24)) (LETT |s| (|OM-STRINGPTRTOSTRING| |sp|) |LIST;OMwrite;$BS;7|) (EXIT |s|))))) - -(DEFUN |LIST;OMwrite;Omd$V;8| (|dev| |x| |$|) (SEQ (SPADCALL |dev| (QREFELT |$| 22)) (|LIST;writeOMList| |dev| |x| |$|) (EXIT (SPADCALL |dev| (QREFELT |$| 23))))) - -(DEFUN |LIST;OMwrite;Omd$BV;9| (|dev| |x| |wholeObj| |$|) (SEQ (COND (|wholeObj| (SPADCALL |dev| (QREFELT |$| 22)))) (|LIST;writeOMList| |dev| |x| |$|) (EXIT (COND (|wholeObj| (SPADCALL |dev| (QREFELT |$| 23))))))) - -(DEFUN |LIST;setUnion;3$;10| (|l1| |l2| |$|) (SPADCALL (SPADCALL |l1| |l2| (QREFELT |$| 29)) (QREFELT |$| 30))) - -(DEFUN |LIST;setIntersection;3$;11| (|l1| |l2| |$|) (PROG (|u|) (RETURN (SEQ (LETT |u| NIL |LIST;setIntersection;3$;11|) (LETT |l1| (SPADCALL |l1| (QREFELT |$| 30)) |LIST;setIntersection;3$;11|) (SEQ G190 (COND ((NULL (COND ((NULL |l1|) (QUOTE NIL)) ((QUOTE T) (QUOTE T)))) (GO G191))) (SEQ (COND ((SPADCALL (|SPADfirst| |l1|) |l2| (QREFELT |$| 32)) (LETT |u| (CONS (|SPADfirst| |l1|) |u|) |LIST;setIntersection;3$;11|))) (EXIT (LETT |l1| (CDR |l1|) |LIST;setIntersection;3$;11|))) NIL (GO G190) G191 (EXIT NIL)) (EXIT |u|))))) - -(DEFUN |LIST;setDifference;3$;12| (|l1| |l2| |$|) (PROG (|l11| |lu|) (RETURN (SEQ (LETT |l1| (SPADCALL |l1| (QREFELT |$| 30)) |LIST;setDifference;3$;12|) (LETT |lu| NIL |LIST;setDifference;3$;12|) (SEQ G190 (COND ((NULL (COND ((NULL |l1|) (QUOTE NIL)) ((QUOTE T) (QUOTE T)))) (GO G191))) (SEQ (LETT |l11| (SPADCALL |l1| 1 (QREFELT |$| 35)) |LIST;setDifference;3$;12|) (COND ((NULL (SPADCALL |l11| |l2| (QREFELT |$| 32))) (LETT |lu| (CONS |l11| |lu|) |LIST;setDifference;3$;12|))) (EXIT (LETT |l1| (CDR |l1|) |LIST;setDifference;3$;12|))) NIL (GO G190) G191 (EXIT NIL)) (EXIT |lu|))))) - -(DEFUN |LIST;convert;$If;13| (|x| |$|) (PROG (#1=#:G102544 |a| #2=#:G102545) (RETURN (SEQ (SPADCALL (CONS (SPADCALL (SPADCALL "construct" (QREFELT |$| 38)) (QREFELT |$| 40)) (PROGN (LETT #1# NIL |LIST;convert;$If;13|) (SEQ (LETT |a| NIL |LIST;convert;$If;13|) (LETT #2# |x| |LIST;convert;$If;13|) G190 (COND ((OR (ATOM #2#) (PROGN (LETT |a| (CAR #2#) |LIST;convert;$If;13|) NIL)) (GO G191))) (SEQ (EXIT (LETT #1# (CONS (SPADCALL |a| (QREFELT |$| 41)) #1#) |LIST;convert;$If;13|))) (LETT #2# (CDR #2#) |LIST;convert;$If;13|) (GO G190) G191 (EXIT (NREVERSE0 #1#))))) (QREFELT |$| 43)))))) - -(DEFUN |List| (#1=#:G102555) (PROG NIL (RETURN (PROG (#2=#:G102556) (RETURN (COND ((LETT #2# (|lassocShiftWithFunction| (LIST (|devaluate| #1#)) (HGET |$ConstructorCache| (QUOTE |List|)) (QUOTE |domainEqualList|)) |List|) (|CDRwithIncrement| #2#)) ((QUOTE T) (|UNWIND-PROTECT| (PROG1 (|List;| #1#) (LETT #2# T |List|)) (COND ((NOT #2#) (HREM |$ConstructorCache| (QUOTE |List|)))))))))))) - -(DEFUN |List;| (|#1|) (PROG (|DV$1| |dv$| |$| #1=#:G102554 |pv$|) (RETURN (PROGN (LETT |DV$1| (|devaluate| |#1|) . #2=(|List|)) (LETT |dv$| (LIST (QUOTE |List|) |DV$1|) . #2#) (LETT |$| (GETREFV 62) . #2#) (QSETREFV |$| 0 |dv$|) (QSETREFV |$| 3 (LETT |pv$| (|buildPredVector| 0 0 (LIST (|HasCategory| |#1| (QUOTE (|SetCategory|))) (|HasCategory| |#1| (QUOTE (|ConvertibleTo| (|InputForm|)))) (LETT #1# (|HasCategory| |#1| (QUOTE (|OrderedSet|))) . #2#) (OR #1# (|HasCategory| |#1| (QUOTE (|SetCategory|)))) (|HasCategory| |#1| (QUOTE (|OpenMath|))) (|HasCategory| (|Integer|) (QUOTE (|OrderedSet|))) (AND (|HasCategory| |#1| (LIST (QUOTE |Evalable|) (|devaluate| |#1|))) (|HasCategory| |#1| (QUOTE (|SetCategory|)))) (OR (AND (|HasCategory| |#1| (LIST (QUOTE |Evalable|) (|devaluate| |#1|))) #1#) (AND (|HasCategory| |#1| (LIST (QUOTE |Evalable|) (|devaluate| |#1|))) (|HasCategory| |#1| (QUOTE (|SetCategory|))))))) . #2#)) (|haddProp| |$ConstructorCache| (QUOTE |List|) (LIST |DV$1|) (CONS 1 |$|)) (|stuffDomainSlots| |$|) (QSETREFV |$| 6 |#1|) (COND ((|testBitVector| |pv$| 5) (PROGN (QSETREFV |$| 25 (CONS (|dispatchFunction| |LIST;OMwrite;$S;6|) |$|)) (QSETREFV |$| 26 (CONS (|dispatchFunction| |LIST;OMwrite;$BS;7|) |$|)) (QSETREFV |$| 27 (CONS (|dispatchFunction| |LIST;OMwrite;Omd$V;8|) |$|)) (QSETREFV |$| 28 (CONS (|dispatchFunction| |LIST;OMwrite;Omd$BV;9|) |$|))))) (COND ((|testBitVector| |pv$| 1) (PROGN (QSETREFV |$| 31 (CONS (|dispatchFunction| |LIST;setUnion;3$;10|) |$|)) (QSETREFV |$| 33 (CONS (|dispatchFunction| |LIST;setIntersection;3$;11|) |$|)) (QSETREFV |$| 36 (CONS (|dispatchFunction| |LIST;setDifference;3$;12|) |$|))))) (COND ((|testBitVector| |pv$| 2) (QSETREFV |$| 44 (CONS (|dispatchFunction| |LIST;convert;$If;13|) |$|)))) |$|)))) - -(MAKEPROP (QUOTE |List|) (QUOTE |infovec|) (LIST (QUOTE #(NIL NIL NIL NIL NIL (|IndexedList| 6 (NRTEVAL 1)) (|local| |#1|) |LIST;nil;$;1| (|Boolean|) |LIST;null;$B;2| |LIST;cons;S2$;3| |LIST;append;3$;4| (|Void|) (|OpenMathDevice|) (0 . |OMputApp|) (|String|) (5 . |OMputSymbol|) (12 . |OMwrite|) (19 . |OMputEndApp|) (|OpenMathEncoding|) (24 . |OMencodingXML|) (28 . |OMopenString|) (34 . |OMputObject|) (39 . |OMputEndObject|) (44 . |OMclose|) (49 . |OMwrite|) (54 . |OMwrite|) (60 . |OMwrite|) (66 . |OMwrite|) (73 . |concat|) (79 . |removeDuplicates|) (84 . |setUnion|) (90 . |member?|) (96 . |setIntersection|) (|Integer|) (102 . |elt|) (108 . |setDifference|) (|Symbol|) (114 . |coerce|) (|InputForm|) (119 . |convert|) (124 . |convert|) (|List| |$|) (129 . |convert|) (134 . |convert|) (|Mapping| 6 6 6) (|NonNegativeInteger|) (|List| 6) (|List| 49) (|Equation| 6) (|Mapping| 8 6) (|Mapping| 8 6 6) (|UniversalSegment| 34) (QUOTE "last") (QUOTE "rest") (QUOTE "first") (QUOTE "value") (|Mapping| 6 6) (|SingleInteger|) (|OutputForm|) (|List| 34) (|Union| 6 (QUOTE "failed")))) (QUOTE #(|setUnion| 139 |setIntersection| 145 |setDifference| 151 |removeDuplicates| 157 |null| 162 |nil| 167 |member?| 171 |elt| 177 |convert| 183 |cons| 188 |concat| 194 |append| 200 |OMwrite| 206)) (QUOTE ((|shallowlyMutable| . 0) (|finiteAggregate| . 0))) (CONS (|makeByteWordVec2| 8 (QUOTE (0 0 0 0 0 0 0 0 0 0 3 0 0 8 4 0 0 8 1 2 4 5))) (CONS (QUOTE #(|ListAggregate&| |StreamAggregate&| |ExtensibleLinearAggregate&| |FiniteLinearAggregate&| |UnaryRecursiveAggregate&| |LinearAggregate&| |RecursiveAggregate&| |IndexedAggregate&| |Collection&| |HomogeneousAggregate&| |OrderedSet&| |Aggregate&| |EltableAggregate&| |Evalable&| |SetCategory&| NIL NIL |InnerEvalable&| NIL NIL |BasicType&| NIL)) (CONS (QUOTE #((|ListAggregate| 6) (|StreamAggregate| 6) (|ExtensibleLinearAggregate| 6) (|FiniteLinearAggregate| 6) (|UnaryRecursiveAggregate| 6) (|LinearAggregate| 6) (|RecursiveAggregate| 6) (|IndexedAggregate| 34 6) (|Collection| 6) (|HomogeneousAggregate| 6) (|OrderedSet|) (|Aggregate|) (|EltableAggregate| 34 6) (|Evalable| 6) (|SetCategory|) (|Type|) (|Eltable| 34 6) (|InnerEvalable| 6 6) (|CoercibleTo| 59) (|ConvertibleTo| 39) (|BasicType|) (|OpenMath|))) (|makeByteWordVec2| 44 (QUOTE (1 13 12 0 14 3 13 12 0 15 15 16 3 6 12 13 0 8 17 1 13 12 0 18 0 19 0 20 2 13 0 15 19 21 1 13 12 0 22 1 13 12 0 23 1 13 12 0 24 1 0 15 0 25 2 0 15 0 8 26 2 0 12 13 0 27 3 0 12 13 0 8 28 2 0 0 0 0 29 1 0 0 0 30 2 0 0 0 0 31 2 0 8 6 0 32 2 0 0 0 0 33 2 0 6 0 34 35 2 0 0 0 0 36 1 37 0 15 38 1 39 0 37 40 1 6 39 0 41 1 39 0 42 43 1 0 39 0 44 2 1 0 0 0 31 2 1 0 0 0 33 2 1 0 0 0 36 1 1 0 0 30 1 0 8 0 9 0 0 0 7 2 1 8 6 0 32 2 0 6 0 34 35 1 2 39 0 44 2 0 0 6 0 10 2 0 0 0 0 29 2 0 0 0 0 11 3 5 12 13 0 8 28 2 5 12 13 0 27 1 5 15 0 25 2 5 15 0 8 26)))))) (QUOTE |lookupIncomplete|))) -@ \section{package LIST2 ListFunctions2} <>= )abbrev package LIST2 ListFunctions2 @@ -1229,277 +183,6 @@ ListToMap(A:SetCategory, B:Type): Exports == Implementation where lb.p @ -\section{domain ALIST AssociationList} -<>= --- list.spad.pamphlet AssociationList.input -)spool AssociationList.output -)set message test on -)set message auto off -)clear all ---S 1 of 10 -Data := Record(monthsOld : Integer, gender : String) ---R ---R ---R (1) Record(monthsOld: Integer,gender: String) ---R Type: Domain ---E 1 - ---S 2 of 10 -al : AssociationList(String,Data) ---R ---R Type: Void ---E 2 - ---S 3 of 10 -al := table() ---R ---R ---R (3) table() ---R Type: AssociationList(String,Record(monthsOld: Integer,gender: String)) ---E 3 - ---S 4 of 10 -al."bob" := [407,"male"]$Data ---R ---R ---R (4) [monthsOld= 407,gender= "male"] ---R Type: Record(monthsOld: Integer,gender: String) ---E 4 - ---S 5 of 10 -al."judith" := [366,"female"]$Data ---R ---R ---R (5) [monthsOld= 366,gender= "female"] ---R Type: Record(monthsOld: Integer,gender: String) ---E 5 - ---S 6 of 10 -al."katie" := [24,"female"]$Data ---R ---R ---R (6) [monthsOld= 24,gender= "female"] ---R Type: Record(monthsOld: Integer,gender: String) ---E 6 - ---S 7 of 10 -al."smokie" := [200,"female"]$Data ---R ---R ---R (7) [monthsOld= 200,gender= "female"] ---R Type: Record(monthsOld: Integer,gender: String) ---E 7 - ---S 8 of 10 -al ---R ---R ---R (8) ---R table ---R "smokie"= [monthsOld= 200,gender= "female"] ---R , ---R "katie"= [monthsOld= 24,gender= "female"] ---R , ---R "judith"= [monthsOld= 366,gender= "female"] ---R , ---R "bob"= [monthsOld= 407,gender= "male"] ---R Type: AssociationList(String,Record(monthsOld: Integer,gender: String)) ---E 8 - ---S 9 of 10 -al."katie" := [23,"female"]$Data ---R ---R ---R (9) [monthsOld= 23,gender= "female"] ---R Type: Record(monthsOld: Integer,gender: String) ---E 9 - ---S 10 of 10 -delete!(al,1) ---R ---R ---R (10) ---R table ---R "katie"= [monthsOld= 23,gender= "female"] ---R , ---R "judith"= [monthsOld= 366,gender= "female"] ---R , ---R "bob"= [monthsOld= 407,gender= "male"] ---R Type: AssociationList(String,Record(monthsOld: Integer,gender: String)) ---E 10 -)spool -)lisp (bye) -@ -<>= -==================================================================== -AssociationList examples -==================================================================== - -The AssociationList constructor provides a general structure for -associative storage. This type provides association lists in which -data objects can be saved according to keys of any type. For a given -association list, specific types must be chosen for the keys and -entries. You can think of the representation of an association list -as a list of records with key and entry fields. - -Association lists are a form of table and so most of the operations -available for Table are also available for AssociationList. They can -also be viewed as lists and can be manipulated accordingly. - -This is a Record type with age and gender fields. - - Data := Record(monthsOld : Integer, gender : String) - Record(monthsOld: Integer,gender: String) - Type: Domain - -In this expression, al is declared to be an association -list whose keys are strings and whose entries are the above records. - - al : AssociationList(String,Data) - Type: Void - -The table operation is used to create an empty association list. - - al := table() - table() - Type: AssociationList(String,Record(monthsOld: Integer,gender: String)) - -You can use assignment syntax to add things to the association list. - - al."bob" := [407,"male"]$Data - [monthsOld=407, gender= "male"] - Type: Record(monthsOld: Integer,gender: String) - - al."judith" := [366,"female"]$Data - [monthsOld=366, gender= "female"] - Type: Record(monthsOld: Integer,gender: String) - - al."katie" := [24,"female"]$Data - [monthsOld=24, gender= "female"] - Type: Record(monthsOld: Integer,gender: String) - -Perhaps we should have included a species field. - - al."smokie" := [200,"female"]$Data - [monthsOld=200, gender= "female"] - Type: Record(monthsOld: Integer,gender: String) - -Now look at what is in the association list. Note that the last-added -(key, entry) pair is at the beginning of the list. - - al - table("smokie" = [monthsOld=200, gender= "female"], - "katie" = [monthsOld=24, gender= "female"], - "judith" = [monthsOld=366, gender= "female"], - "bob" = [monthsOld=407, gender= "male"]) - Type: AssociationList(String,Record(monthsOld: Integer,gender: String)) - -You can reset the entry for an existing key. - - al."katie" := [23,"female"]$Data - [monthsOld=23, gender= "female"] - Type: Record(monthsOld: Integer,gender: String) - -Use delete! to destructively remove an element of the association -list. Use delete to return a copy of the association list with the -element deleted. The second argument is the index of the element to -delete. - - delete!(al,1) - table("katie" = [monthsOld=23, gender= "female"], - "judith" = [monthsOld=366, gender= "female"], - "bob" = [monthsOld=407, gender= "male"]) - Type: AssociationList(String,Record(monthsOld: Integer,gender: String)) - -See Also: -o )help Table -o )help List -o )show AssociationList -o $AXIOM/doc/src/algebra/list.spad.dvi - -@ -<>= -)abbrev domain ALIST AssociationList -++ Author: -++ Date Created: -++ Change History: -++ Basic Operations: empty, empty?, keys, \#, concat, first, rest, -++ setrest!, search, setelt, remove! -++ Related Constructors: -++ Also See: List -++ AMS Classification: -++ Keywords: list, association list -++ Description: -++ \spadtype{AssociationList} implements association lists. These -++ may be viewed as lists of pairs where the first part is a key -++ and the second is the stored value. For example, the key might -++ be a string with a persons employee identification number and -++ the value might be a record with personnel data. - -AssociationList(Key:SetCategory, Entry:SetCategory): - AssociationListAggregate(Key, Entry) == add - Pair ==> Record(key:Key, entry:Entry) - Rep := Reference List Pair - - dictionary() == ref empty() - empty() == dictionary() - empty? t == empty? deref t - entries(t:%):List(Pair) == deref t - parts(t:%):List(Pair) == deref t - keys t == [k.key for k in deref t] - # t == # deref t - first(t:%):Pair == first deref t - rest t == ref rest deref t - concat(p:Pair, t:%) == ref concat(p, deref t) - setrest_!(a:%, b:%) == ref setrest_!(deref a, deref b) - setfirst_!(a:%, p:Pair) == setfirst_!(deref a,p) - minIndex(a:%):Integer == minIndex(deref a) - maxIndex(a:%):Integer == maxIndex(deref a) - - search(k, t) == - for r in deref t repeat - k = r.key => return(r.entry) - "failed" - - latex(a : %) : String == - l : List Pair := entries a - s : String := "\left[" - while not empty?(l) repeat - r : Pair := first l - l := rest l - s := concat(s, concat(latex r.key, concat(" = ", latex r.entry)$String)$String)$String - if not empty?(l) then s := concat(s, ", ")$String - concat(s, " \right]")$String - --- assoc(k, l) == --- (r := find(#1.key=k, l)) case "failed" => "failed" --- r - - assoc(k, t) == - for r in deref t repeat - k = r.key => return r - "failed" - - setelt(t:%, k:Key, e:Entry) == - (r := assoc(k, t)) case Pair => (r::Pair).entry := e - setref(t, concat([k, e], deref t)) - e - - remove_!(k:Key, t:%) == - empty?(l := deref t) => "failed" - k = first(l).key => - setref(t, rest l) - first(l).entry - prev := l - curr := rest l - while not empty? curr and first(curr).key ^= k repeat - prev := curr - curr := rest curr - empty? curr => "failed" - setrest_!(prev, rest curr) - first(curr).entry - -@ \section{License} <>= --Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. @@ -1536,12 +219,9 @@ AssociationList(Key:SetCategory, Entry:SetCategory): <<*>>= <> -<> -<> <> <> <> -<> @ \eject \begin{thebibliography}{99} diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index 2e7c231..ca14fd6 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -789,6 +789,8 @@ schaum17 fix 14.355, 14.356
regression file fixed created
20081208.01.tpd.patch CATS hyperbolicrules.input added
+20081209.01.tpd.patch +bookvol10.3 add domains
\ No newline at end of file