diff --git a/books/bookvol10.3.pamphlet b/books/bookvol10.3.pamphlet index 9b3fdea..8f77e34 100644 --- a/books/bookvol10.3.pamphlet +++ b/books/bookvol10.3.pamphlet @@ -6717,7 +6717,7 @@ AssociatedLieAlgebra(R:CommutativeRing,A:NonAssociativeAlgebra R): \section{domain ALIST AssociationList} <>= -- list.spad.pamphlet AssociationList.input -)sys rm AssociationList.output +)sys rm -f AssociationList.output )spool AssociationList.output )set message test on )set message auto off @@ -7444,7 +7444,7 @@ Automorphism(R:Ring): Join(Group, Eltable(R, R)) with \section{domain BBTREE BalancedBinaryTree} <>= -- tree.spad.pamphlet BalancedBinaryTree.input -)sys rm BalancedBinaryTree.output +)sys rm -f BalancedBinaryTree.output )spool BalancedBinaryTree.output )set message test on )set message auto off @@ -8152,7 +8152,7 @@ BasicFunctions(): E == I where \section{domain BOP BasicOperator} <>= -- op.spad.pamphlet BasicOperator.input -)sys rm BasicOperator.output +)sys rm -f BasicOperator.output )spool BasicOperator.output )set message test on )set message auto off @@ -8687,7 +8687,7 @@ BasicOperator(): Exports == Implementation where \section{domain BINARY BinaryExpansion} <>= -- radix.spad.pamphlet BinaryExpansion.input -)sys rm BinaryExpansion.output +)sys rm -f BinaryExpansion.output )spool BinaryExpansion.output )set message test on )set message auto off @@ -9122,7 +9122,7 @@ BinaryFile: Cat == Def where \section{domain BSTREE BinarySearchTree} <>= -- tree.spad.pamphlet BinarySearchTree.input -)sys rm BinarySearchTree.output +)sys rm -f BinarySearchTree.output )spool BinarySearchTree.output )set message test on )set message auto off @@ -9929,7 +9929,7 @@ Boolean(): Join(OrderedSet, Finite, Logic, ConvertibleTo InputForm) with \section{domain CARD CardinalNumber} <>= -- card.spad.pamphlet CardinalNumber.input -)sys rm CardinalNumber.output +)sys rm -f CardinalNumber.output )spool CardinalNumber.output )set message test on )set message auto off @@ -10476,7 +10476,7 @@ CardinalNumber: Join(OrderedSet, AbelianMonoid, Monoid, \section{domain CARTEN CartesianTensor} <>= -- carten.spad.pamphlet CartesianTensor.input -)sys rm CartesianTensor.output +)sys rm -f CartesianTensor.output )spool CartesianTensor.output )set message test on )set message auto off @@ -12071,7 +12071,7 @@ CartesianTensor(minix, dim, R): Exports == Implementation where \section{domain CHAR Character} <>= -- string.spad.pamphlet Character.input -)sys rm Character.output +)sys rm -f Character.output )spool Character.output )set message test on )set message auto off @@ -12462,7 +12462,7 @@ Character: OrderedFinite() with \section{domain CCLASS CharacterClass} <>= -- string.spad.pamphlet CharacterClass.input -)sys rm CharacterClass.output +)sys rm -f CharacterClass.output )spool CharacterClass.output )set message test on )set message auto off @@ -13075,7 +13075,7 @@ $\mathbb{R}_{m,m}$ & --------$>$ & $\mathbb{R}^{4^m}$ \\ \end{tabular} <>= -- clifford.spad.pamphlet CliffordAlgebra.input -)sys rm CliffordAlgebra.output +)sys rm -f CliffordAlgebra.output )spool CliffordAlgebra.output )set message test on )set message auto off @@ -14130,7 +14130,7 @@ Commutator: Export == Implement where \section{domain COMPLEX Complex} <>= -- gaussian.spad.pamphlet Complex.input -)sys rm Complex.output +)sys rm -f Complex.output )spool Complex.output )set message test on )set message auto off @@ -14647,7 +14647,7 @@ Complex(R:CommutativeRing): ComplexCategory(R) with \section{domain CONTFRAC ContinuedFraction} <>= -- contfrac.spad.pamphlet ContinuedFraction.input -)sys rm ContinuedFraction.output +)sys rm -f ContinuedFraction.output )spool ContinuedFraction.output )set message test on )set message auto off @@ -15818,7 +15818,7 @@ DataList(S:OrderedSet) : Exports == Implementation where \section{domain DECIMAL DecimalExpansion} <>= -- radix.spad.pamphlet DecimalExpansion.input -)sys rm DecimalExpansion.output +)sys rm -f DecimalExpansion.output )spool DecimalExpansion.output )set message test on )set message auto off @@ -17820,16 +17820,16 @@ DenavitHartenbergMatrix(R): Exports == Implementation where identity: () -> % ++ identity() create the identity dhmatrix rotatex: R -> % - ++ rotatex(r) returns a dhmatrix for rotation about axis X for r degrees + ++ rotatex(r) returns a dhmatrix for rotation about axis x for r degrees rotatey: R -> % - ++ rotatey(r) returns a dhmatrix for rotation about axis Y for r degrees + ++ rotatey(r) returns a dhmatrix for rotation about axis y for r degrees rotatez: R -> % - ++ rotatez(r) returns a dhmatrix for rotation about axis Z for r degrees + ++ rotatez(r) returns a dhmatrix for rotation about axis z for r degrees scale: (R,R,R) -> % - ++ scale(sx,sy,sz) returns a dhmatrix for scaling in the X, Y and Z + ++ scale(sx,sy,sz) returns a dhmatrix for scaling in the x, y and z ++ directions translate: (R,R,R) -> % - ++ translate(X,Y,Z) returns a dhmatrix for translation by X, Y, and Z + ++ translate(x,y,z) returns a dhmatrix for translation by x, y, and z Implementation ==> Matrix(R) add @@ -17993,7 +17993,7 @@ Dequeue(S:SetCategory): DequeueAggregate S with \section{domain DERHAM DeRhamComplex} <>= -- derham.spad.pamphlet DeRhamComplex.input -)sys rm DeRhamComplex.output +)sys rm -f DeRhamComplex.output )spool DeRhamComplex.output )set message test on )set message auto off @@ -19332,7 +19332,7 @@ DirectProductModule(n, R, S): DPcategory == DPcapsule where \section{domain DMP DistributedMultivariatePolynomial} <>= -- gdpoly.spad.pamphlet DistributedMultivariatePolynomial.input -)sys rm DistributedMultivariatePolynomial.output +)sys rm -f DistributedMultivariatePolynomial.output )spool DistributedMultivariatePolynomial.output )set message test on )set message auto off @@ -19822,7 +19822,7 @@ complex number.) \end{quote} <>= -- sf.spad.pamphlet DoubleFloat.input -)sys rm DoubleFloat.output +)sys rm -f DoubleFloat.output )spool DoubleFloat.output )set message test on )set message auto off @@ -22425,7 +22425,7 @@ d03fafAnnaType():PartialDifferentialEquationsSolverCategory == Result add \section{domain EQ Equation} <>= -- equation2.spad.pamphlet Equation.input -)sys rm Equation.output +)sys rm -f Equation.output )spool Equation.output )set message test on )set message auto off @@ -22882,7 +22882,7 @@ Equation(S: Type): public == private where \section{domain EQTBL EqTable} <>= -- table.spad.pamphlet EqTable.input -)sys rm EqTable.output +)sys rm -f EqTable.output )spool EqTable.output )set message test on )set message auto off @@ -23246,7 +23246,7 @@ EuclideanModularRing(S,R,Mod,reduction:(R,Mod) -> R, \section{domain EXIT Exit} <>= -- void.spad.pamphlet Exit.input -)sys rm Exit.output +)sys rm -f Exit.output )spool Exit.output )set message test on )set message auto off @@ -23639,7 +23639,7 @@ ExponentialExpansion(R,FE,var,cen): Exports == Implementation where \section{domain EXPR Expression} <>= -- expr.spad.pamphlet Expression.input -)sys rm Expression.output +)sys rm -f Expression.output )spool Expression.output )set message test on )set message auto off @@ -25846,7 +25846,7 @@ e04ucfAnnaType(): NumericalOptimizationCategory == Result add \section{domain FR Factored} <>= -- fr.spad.pamphlet Factored.input -)sys rm Factored.output +)sys rm -f Factored.output )spool Factored.output )set message test on )set message auto off @@ -27087,7 +27087,7 @@ Factored(R: IntegralDomain): Exports == Implementation where \section{domain FILE File} <>= -- files.spad.pamphlet File.input -)sys rm File.output +)sys rm -f File.output )spool File.output )set message test on )set message auto off @@ -27399,7 +27399,7 @@ File(S:SetCategory): FileCategory(FileName, S) with \section{domain FNAME FileName} <>= -- fname.spad.pamphlet FileName.input -)sys rm FileName.output +)sys rm -f FileName.output )spool FileName.output )set message test on )set message auto off @@ -30001,7 +30001,7 @@ divisor of the order of the multiplicative group" \section{domain FARRAY FlexibleArray} <>= -- array1.spad.pamphlet FlexibleArray.input -)sys rm FlexibleArray.output +)sys rm -f FlexibleArray.output )spool FlexibleArray.output )set message test on )set message auto off @@ -30409,7 +30409,7 @@ of shift for negative arguments will cause bugs in other parts of Axiom. <>= -- float.spad.pamphlet Float.input -)sys rm Float.output +)sys rm -f Float.output )spool Float.output )set message test on )set message auto off @@ -34298,7 +34298,7 @@ FourierSeries(R:Join(CommutativeRing,Algebra(Fraction Integer)), \section{domain FRAC Fraction} <>= -- fraction.spad.pamphlet Fraction.input -)sys rm Fraction.output +)sys rm -f Fraction.output )spool Fraction.output )set message test on )set message auto off @@ -36234,7 +36234,7 @@ FreeNilpotentLie(n:NNI,class:NNI,R: CommutativeRing): Export == Implement where \section{domain FPARFRAC FullPartialFractionExpansion} <>= -- fparfrac.spad.pamphlet FullPartialFractionExpansion.input -)sys rm FullPartialFractionExpansion.output +)sys rm -f FullPartialFractionExpansion.output )spool FullPartialFractionExpansion.output )set message test on )set message auto off @@ -36950,7 +36950,7 @@ FunctionCalled(f:Symbol): SetCategory with \section{domain GDMP GeneralDistributedMultivariatePolynomial} <>= -- gdpoly.spad.pamphlet GeneralDistributedMultivariatePolynomial.input -)sys rm GeneralDistributedMultivariatePolynomial.output +)sys rm -f GeneralDistributedMultivariatePolynomial.output )spool GeneralDistributedMultivariatePolynomial.output )set message test on )set message auto off @@ -38170,7 +38170,7 @@ GeneralPolynomialSet(R,E,VarSet,P) : Exports == Implementation where \section{domain GSTBL GeneralSparseTable} <>= -- table.spad.pamphlet GeneralSparseTable.input -)sys rm GeneralSparseTable.output +)sys rm -f GeneralSparseTable.output )spool GeneralSparseTable.output )set message test on )set message auto off @@ -39539,7 +39539,7 @@ HashTable(Key, Entry, hashfn): Exports == Implementation where \section{domain HEAP Heap} <>= -- bags.spad.pamphlet Heap.input -)sys rm Heap.output +)sys rm -f Heap.output )spool Heap.output )set message test on )set message auto off @@ -39805,7 +39805,7 @@ Heap(S:OrderedSet): Exports == Implementation where \section{domain HEXADEC HexadecimalExpansion} <>= -- radix.spad.pamphlet HexadecimalExpansion.input -)sys rm HexadecimalExpansion.output +)sys rm -f HexadecimalExpansion.output )spool HexadecimalExpansion.output )set message test on )set message auto off @@ -40214,7 +40214,7 @@ HomogeneousDirectProduct(dim,S) : T == C where \section{domain HDMP HomogeneousDistributedMultivariatePolynomial} <>= -- gdpoly.spad.pamphlet HomogeneousDistributedMultivariatePolynomial.input -)sys rm HomogeneousDistributedMultivariatePolynomial.output +)sys rm -f HomogeneousDistributedMultivariatePolynomial.output )spool HomogeneousDistributedMultivariatePolynomial.output )set message test on )set message auto off @@ -45962,7 +45962,7 @@ 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 -)sys rm Integer.output +)sys rm -f Integer.output )spool Integer.output )set message test on )set message auto off @@ -47903,7 +47903,7 @@ Interval(R:Join(FloatingPointSystem,TranscendentalFunctionCategory)): IntervalCa \section{domain KERNEL Kernel} <>= -- kl.spad.pamphlet Kernel.input -)sys rm Kernel.output +)sys rm -f Kernel.output )spool Kernel.output )set message test on )set message auto off @@ -48392,7 +48392,7 @@ Kernel(S:OrderedSet): Exports == Implementation where \section{domain KAFILE KeyedAccessFile} <>= -- files.spad.pamphlet KeyedAccessFile.input -)sys rm KeyedAccessFile.output +)sys rm -f KeyedAccessFile.output )spool KeyedAccessFile.output )set message test on )set message auto off @@ -48962,7 +48962,7 @@ LaurentPolynomial(R, UP): Exports == Implementation where \section{domain LIB Library} <>= -- files.spad.pamphlet Library.input -)sys rm Library.output +)sys rm -f Library.output )spool Library.output )set message test on )set message auto off @@ -49145,7 +49145,7 @@ Library(): TableAggregate(String, Any) with \section{domain LEXP LieExponentials} <>= -- xlpoly.spad.pamphlet LieExponentials.input -)sys rm LieExponentials.output +)sys rm -f LieExponentials.output )spool LieExponentials.output )set message test on )set message auto off @@ -49540,7 +49540,7 @@ LieExponentials(VarSet, R, Order): XDPcat == XDPdef where \section{domain LPOLY LiePolynomial} <>= -- xlpoly.spad.pamphlet LiePolynomial.input -)sys rm LiePolynomial.output +)sys rm -f LiePolynomial.output )spool LiePolynomial.output )set message test on )set message auto off @@ -50419,7 +50419,7 @@ LieSquareMatrix(n,R): Exports == Implementation where \section{domain LODO LinearOrdinaryDifferentialOperator} <>= -- lodo.spad.pamphlet LinearOrdinaryDifferentialOperator.input -)sys rm LinearOrdinaryDifferentialOperator.output +)sys rm -f LinearOrdinaryDifferentialOperator.output )spool LinearOrdinaryDifferentialOperator.output )set message test on )set message auto off @@ -51010,7 +51010,7 @@ LinearOrdinaryDifferentialOperator(A:Ring, diff: A -> A): \section{domain LODO1 LinearOrdinaryDifferentialOperator1} <>= -- lodo.spad.pamphlet LinearOrdinaryDifferentialOperator1.input -)sys rm LinearOrdinaryDifferentialOperator1.output +)sys rm -f LinearOrdinaryDifferentialOperator1.output )spool LinearOrdinaryDifferentialOperator1.output )set message test on )set message auto off @@ -51490,7 +51490,7 @@ LinearOrdinaryDifferentialOperator1(A:DifferentialRing) == \section{domain LODO2 LinearOrdinaryDifferentialOperator2} <>= -- lodo.spad.pamphlet LinearOrdinaryDifferentialOperator2.input -)sys rm LinearOrdinaryDifferentialOperator2.output +)sys rm -f LinearOrdinaryDifferentialOperator2.output )spool LinearOrdinaryDifferentialOperator2.output )set message test on )set message auto off @@ -52109,7 +52109,7 @@ LinearOrdinaryDifferentialOperator2(A, M): Exports == Implementation where \section{domain LIST List} <>= -- list.spad.pamphlet List.input -)sys rm List.output +)sys rm -f List.output )spool List.output )set message test on )set message auto off @@ -53521,7 +53521,7 @@ Localize(M:Module R, \section{domain LWORD LyndonWord} <>= -- xlpoly.spad.pamphlet LyndonWord.input -)sys rm LyndonWord.output +)sys rm -f LyndonWord.output )spool LyndonWord.output )set message test on )set message auto off @@ -54817,7 +54817,7 @@ MachineInteger(): Exports == Implementation where \section{domain MAGMA Magma} <>= -- xlpoly.spad.pamphlet Magma.input -)sys rm Magma.output +)sys rm -f Magma.output )spool Magma.output )set message test on )set message auto off @@ -55366,7 +55366,7 @@ MakeCachableSet(S:SetCategory): Exports == Implementation where \section{domain MATRIX Matrix} <>= -- matrix.spad.pamphlet Matrix.input -)sys rm Matrix.output +)sys rm -f Matrix.output )spool Matrix.output )set message test on )set message auto off @@ -57921,7 +57921,7 @@ MonoidRing(R: Ring, M: Monoid): MRcategory == MRdefinition where \section{domain MSET Multiset} <>= -- mset.spad.pamphlet Multiset.input -)sys rm Multiset.output +)sys rm -f Multiset.output )spool Multiset.output )set message test on )set message auto off @@ -58482,7 +58482,7 @@ Multiset(S: SetCategory): MultisetAggregate S with \section{domain MPOLY MultivariatePolynomial} <>= -- multpoly.spad.pamphlet MultivariatePolynomial.input -)sys rm MultivariatePolynomial.output +)sys rm -f MultivariatePolynomial.output )spool MultivariatePolynomial.output )set message test on )set message auto off @@ -59104,7 +59104,7 @@ MyUnivariatePolynomial(x:Symbol, R:Ring): coerce: Variable(x) -> % ++ coerce(x) converts the variable x to a univariate polynomial. fmecg: (%,NonNegativeInteger,R,%) -> % - ++ fmecg(p1,e,r,p2) finds X : p1 - r * X**e * p2 + ++ fmecg(p1,e,r,p2) finds x : p1 - r * x**e * p2 if R has univariate: (R, Symbol) -> SparseUnivariatePolynomial R then coerce: R -> % coerce: Polynomial R -> % @@ -59855,8 +59855,8 @@ NewSparseUnivariatePolynomial(R): Exports == Implementation where Exports == Join(UnivariatePolynomialCategory(R), CoercibleTo(SUPR),RetractableTo(SUPR)) with fmecg : (%,NNI,R,%) -> % - ++ \axiom{fmecg(p1,e,r,p2)} returns \axiom{p1 - r * X**e * p2} - ++ where \axiom{X} is \axiom{monomial(1,1)} + ++ \axiom{fmecg(p1,e,r,p2)} returns \axiom{p1 - r * x**e * p2} + ++ where \axiom{x} is \axiom{monomial(1,1)} monicModulo : ($, $) -> $ ++ \axiom{monicModulo(a,b)} returns \axiom{r} such that \axiom{r} is ++ reduced w.r.t. \axiom{b} and \axiom{b} divides \axiom{a -r} @@ -59867,16 +59867,18 @@ NewSparseUnivariatePolynomial(R): Exports == Implementation where ++ \axiom{c^n * a - r} where \axiom{c} is \axiom{leadingCoefficient(b)} ++ and \axiom{n} is as small as possible with the previous properties. lazyPseudoRemainder: ($,$) -> $ - ++ \axiom{lazyPseudoRemainder(a,b)} returns \axiom{r} if \axiom{lazyResidueClass(a,b)} - ++ returns \axiom{[r,c,n]}. This lazy pseudo-remainder is computed by - ++ means of the \axiomOpFrom{fmecg}{NewSparseUnivariatePolynomial} operation. + ++ \axiom{lazyPseudoRemainder(a,b)} returns \axiom{r} if + ++ \axiom{lazyResidueClass(a,b)} returns \axiom{[r,c,n]}. + ++ This lazy pseudo-remainder is computed by means of the + ++ \axiomOpFrom{fmecg}{NewSparseUnivariatePolynomial} operation. lazyPseudoDivide: ($,$) -> Record(coef:R, gap:NNI, quotient:$, remainder: $) ++ \axiom{lazyPseudoDivide(a,b)} returns \axiom{[c,g,q,r]} such that - ++ \axiom{c^n * a = q*b +r} and \axiom{lazyResidueClass(a,b)} returns \axiom{[r,c,n]} - ++ where \axiom{n + g = max(0, degree(b) - degree(a) + 1)}. + ++ \axiom{c^n * a = q*b +r} and \axiom{lazyResidueClass(a,b)} returns + ++ \axiom{[r,c,n]} where + ++ \axiom{n + g = max(0, degree(b) - degree(a) + 1)}. lazyPseudoQuotient: ($,$) -> $ - ++ \axiom{lazyPseudoQuotient(a,b)} returns \axiom{q} if \axiom{lazyPseudoDivide(a,b)} - ++ returns \axiom{[c,g,q,r]} + ++ \axiom{lazyPseudoQuotient(a,b)} returns \axiom{q} if + ++ \axiom{lazyPseudoDivide(a,b)} returns \axiom{[c,g,q,r]} if R has IntegralDomain then subResultantsChain: ($, $) -> List $ @@ -59885,28 +59887,32 @@ NewSparseUnivariatePolynomial(R): Exports == Implementation where ++ degree. lastSubResultant: ($, $) -> $ ++ \axiom{lastSubResultant(a,b)} returns \axiom{resultant(a,b)} - ++ if \axiom{a} and \axiom{b} has no non-trivial gcd in \axiom{R^(-1) P} + ++ if \axiom{a} and \axiom{b} has no non-trivial gcd + ++ in \axiom{R^(-1) P} ++ otherwise the non-zero sub-resultant with smallest index. extendedSubResultantGcd: ($, $) -> Record(gcd: $, coef1: $, coef2: $) - ++ \axiom{extendedSubResultantGcd(a,b)} returns \axiom{[g,ca, cb]} such - ++ that \axiom{g} is a gcd of \axiom{a} and \axiom{b} in \axiom{R^(-1) P} - ++ and \axiom{g = ca * a + cb * b} + ++ \axiom{extendedSubResultantGcd(a,b)} returns \axiom{[g,ca, cb]} + ++ such that \axiom{g} is a gcd of \axiom{a} and \axiom{b} in + ++ \axiom{R^(-1) P} and \axiom{g = ca * a + cb * b} halfExtendedSubResultantGcd1: ($, $) -> Record(gcd: $, coef1: $) - ++ \axiom{halfExtendedSubResultantGcd1(a,b)} returns \axiom{[g,ca]} such that - ++ \axiom{extendedSubResultantGcd(a,b)} returns \axiom{[g,ca, cb]} + ++ \axiom{halfExtendedSubResultantGcd1(a,b)} returns \axiom{[g,ca]} + ++ such that \axiom{extendedSubResultantGcd(a,b)} returns + ++ \axiom{[g,ca, cb]} halfExtendedSubResultantGcd2: ($, $) -> Record(gcd: $, coef2: $) - ++ \axiom{halfExtendedSubResultantGcd2(a,b)} returns \axiom{[g,cb]} such that - ++ \axiom{extendedSubResultantGcd(a,b)} returns \axiom{[g,ca, cb]} + ++ \axiom{halfExtendedSubResultantGcd2(a,b)} returns \axiom{[g,cb]} + ++ such that \axiom{extendedSubResultantGcd(a,b)} returns + ++ \axiom{[g,ca, cb]} extendedResultant: ($, $) -> Record(resultant: R, coef1: $, coef2: $) ++ \axiom{extendedResultant(a,b)} returns \axiom{[r,ca,cb]} such that ++ \axiom{r} is the resultant of \axiom{a} and \axiom{b} and ++ \axiom{r = ca * a + cb * b} halfExtendedResultant1: ($, $) -> Record(resultant: R, coef1: $) - ++ \axiom{halfExtendedResultant1(a,b)} returns \axiom{[r,ca]} such that - ++ \axiom{extendedResultant(a,b)} returns \axiom{[r,ca, cb]} + ++ \axiom{halfExtendedResultant1(a,b)} returns \axiom{[r,ca]} + ++ such that \axiom{extendedResultant(a,b)} returns + ++ \axiom{[r,ca, cb]} halfExtendedResultant2: ($, $) -> Record(resultant: R, coef2: $) - ++ \axiom{halfExtendedResultant2(a,b)} returns \axiom{[r,ca]} such that - ++ \axiom{extendedResultant(a,b)} returns \axiom{[r,ca, cb]} + ++ \axiom{halfExtendedResultant2(a,b)} returns \axiom{[r,ca]} such + ++ that \axiom{extendedResultant(a,b)} returns \axiom{[r,ca, cb]} Implementation == SparseUnivariatePolynomial(R) add @@ -60095,7 +60101,7 @@ NewSparseUnivariatePolynomial(R): Exports == Implementation where \section{domain NONE None} <>= -- any.spad.pamphlet None.input -)sys rm None.output +)sys rm -f None.output )spool None.output )set message test on )set message auto off @@ -60668,7 +60674,7 @@ associative, since $I*(J*K) \ne (I*J)*K$. \includegraphics{ps/v103octoniongraph.eps} <>= -- oct.spad.pamphlet Octonion.input -)sys rm Octonion.output +)sys rm -f Octonion.output )spool Octonion.output )set message test on )set message auto off @@ -61138,7 +61144,7 @@ ODEIntensityFunctionsTable(): E == I where \section{domain ARRAY1 OneDimensionalArray} <>= -- array1.spad.pamphlet OneDimensionalArray.input -)sys rm OneDimensionalArray.output +)sys rm -f OneDimensionalArray.output )spool OneDimensionalArray.output )set message test on )set message auto off @@ -62069,7 +62075,7 @@ OpenMathErrorKind() : SetCategory with \section{domain OP Operator} <>= -- opalg.spad.pamphlet Operator.input -)sys rm Operator.output +)sys rm -f Operator.output )spool Operator.output )set message test on )set message auto off @@ -63111,7 +63117,7 @@ OrderedFreeMonoid(S: OrderedSet): OFMcategory == OFMdefinition where \section{domain OVAR OrderedVariableList} <>= -- variable.spad.pamphlet OrderedVariableList.input -)sys rm OrderedVariableList.output +)sys rm -f OrderedVariableList.output )spool OrderedVariableList.output )set message test on )set message auto off @@ -63273,7 +63279,7 @@ OrderedVariableList(VariableList:List Symbol): \pageto{SequentialDifferentialPolynomial}{SDPOL} <>= -- dpolcat.spad.pamphlet OrderlyDifferentialPolynomial.input -)sys rm OrderlyDifferentialPolynomial.output +)sys rm -f OrderlyDifferentialPolynomial.output )spool OrderlyDifferentialPolynomial.output )set message test on )set message auto off @@ -65691,7 +65697,7 @@ ParametricSurface(ComponentFunction): Exports == Implementation where \section{domain PFR PartialFraction} <>= -- pfr.spad.pamphlet PartialFraction.input -)sys rm PartialFraction.output +)sys rm -f PartialFraction.output )spool PartialFraction.output )set message test on )set message auto off @@ -67454,7 +67460,7 @@ domain. <>= -- perm.spad.pamphlet Permutation.input -)sys rm Permutation.output +)sys rm -f Permutation.output )spool Permutation.output )set message test on )set message auto off @@ -68796,7 +68802,7 @@ Pi(): Exports == Implementation where \section{domain ACPLOT PlaneAlgebraicCurvePlot} <>= -- acplot.spad.pamphlet PlaneAlgebraicCurvePlot.input -)sys rm PlaneAlgebraicCurvePlot.output +)sys rm -f PlaneAlgebraicCurvePlot.output )spool PlaneAlgebraicCurvePlot.output )set message test on )set message auto off @@ -70061,7 +70067,7 @@ PlaneAlgebraicCurvePlot(): PlottablePlaneCurveCategory _ \section{domain PLOT Plot} <>= -- plot.spad.pamphlet Plot.input -)sys rm Plot.output +)sys rm -f Plot.output )spool Plot.output )set message test on )set message auto off @@ -71548,7 +71554,7 @@ Point(R:Ring) : Exports == Implementation where \section{domain POLY Polynomial} <>= -- multpoly.spad.pamphlet Polynomial.input -)sys rm Polynomial.output +)sys rm -f Polynomial.output )spool Polynomial.output )set message test on )set message auto off @@ -73027,7 +73033,7 @@ PolynomialRing(R:Ring,E:OrderedAbelianMonoid): T == C --assertions if R has IntegralDomain and E has CancellationAbelianMonoid then fmecg: (%,E,R,%) -> % - ++ fmecg(p1,e,r,p2) finds X : p1 - r * X**e * p2 + ++ fmecg(p1,e,r,p2) finds x : p1 - r * x**e * p2 if R has canonicalUnitNormal then canonicalUnitNormal ++ canonicalUnitNormal guarantees that the function ++ unitCanonical returns the same representative for all @@ -74060,7 +74066,7 @@ QuasiAlgebraicSet(R, Var,Expon,Dpoly) : C == T \section{domain QUAT Quaternion} <>= -- quat.spad.pamphlet Quaternion.input -)sys rm Quaternion.output +)sys rm -f Quaternion.output )spool Quaternion.output )set message test on )set message auto off @@ -74878,7 +74884,7 @@ RadicalFunctionField(F, UP, UPUP, radicnd, n): Exports == Impl where \section{domain RADIX RadixExpansion} <>= -- radix.spad.pamphlet RadixExpansion.input -)sys rm RadixExpansion.output +)sys rm -f RadixExpansion.output )spool RadixExpansion.output )set message test on )set message auto off @@ -75548,7 +75554,7 @@ computations are done excatly. They can thus be quite time consuming when depending on several "real roots". <>= -- reclos.spad.pamphlet RealClosure.input -)sys rm RealClosure.output +)sys rm -f RealClosure.output )spool RealClosure.output )set message test on )set message auto off @@ -77514,7 +77520,7 @@ systems. This method is refined in the package {\bf LazardSetSolvingPackage} in order to produce decompositions by means of Lazard triangular sets. <>= -- regset.spad.pamphlet RegularTriangularSet.input -)sys rm RegularTriangularSet.output +)sys rm -f RegularTriangularSet.output )spool RegularTriangularSet.output )set message test on )set message auto off @@ -80315,7 +80321,7 @@ RightOpenIntervalRootCharacterization(TheField,ThePolDom) : PUB == PRIV where \section{domain ROMAN RomanNumeral} <>= -- integer.spad.pamphlet RomanNumeral.input -)sys rm RomanNumeral.output +)sys rm -f RomanNumeral.output )spool RomanNumeral.output )set message test on )set message auto off @@ -81766,7 +81772,7 @@ ScriptFormulaFormat(): public == private where \section{domain SEG Segment} <>= -- seg.spad.pamphlet Segment.input -)sys rm Segment.output +)sys rm -f Segment.output )spool Segment.output )set message test on )set message auto off @@ -82047,7 +82053,7 @@ Segment(S:Type): SegmentCategory(S) with \section{domain SEGBIND SegmentBinding} <>= -- seg.spad.pamphlet SegmentBinding.input -)sys rm SegmentBinding.output +)sys rm -f SegmentBinding.output )spool SegmentBinding.output )set message test on )set message auto off @@ -82229,7 +82235,7 @@ SegmentBinding(S:Type): Type with \section{domain SET Set} <>= -- sets.spad.pamphlet Set.input -)sys rm Set.output +)sys rm -f Set.output )spool Set.output )set message test on )set message auto off @@ -83717,7 +83723,7 @@ as it relies on calling {\bf ONEP} which is a function specific to Codemist Common Lisp but is not defined in Common Lisp. <>= -- si.spad.pamphlet SingleInteger.input -)sys rm SingleInteger.output +)sys rm -f SingleInteger.output )spool SingleInteger.output )set message test on )set message auto off @@ -85281,7 +85287,7 @@ SparseMultivariateTaylorSeries(Coef,Var,SMP):_ \section{domain STBL SparseTable} <>= -- table.spad.pamphlet SparseTable.input -)sys rm SparseTable.output +)sys rm -f SparseTable.output )spool SparseTable.output )set message test on )set message auto off @@ -85998,7 +86004,7 @@ SparseUnivariatePolynomial(R:Ring): UnivariatePolynomialCategory(R) with ++ an output form (see \spadtype{OutputForm}) printed as a polynomial in the ++ output form variable. fmecg: (%,NonNegativeInteger,R,%) -> % - ++ fmecg(p1,e,r,p2) finds X : p1 - r * X**e * p2 + ++ fmecg(p1,e,r,p2) finds x : p1 - r * x**e * p2 == PolynomialRing(R,NonNegativeInteger) add --representations @@ -86174,7 +86180,7 @@ SparseUnivariatePolynomial(R:Ring): UnivariatePolynomialCategory(R) with rout:= [[ee,a], :rout] null p1 => reverse(rout)::% -- nreverse? "failed" - fmecg(p1,e,r,p2) == -- p1 - r * X**e * p2 + fmecg(p1,e,r,p2) == -- p1 - r * x**e * p2 rout:%:= [] r:= - r for tm in p2 repeat @@ -88020,7 +88026,7 @@ SplittingTree(V,C) : Exports == Implementation where \section{domain SREGSET SquareFreeRegularTriangularSet} <>= -- sregset.spad.pamphlet SquareFreeRegularTriangularSet.input -)sys rm SquareFreeRegularTriangularSet.output +)sys rm -f SquareFreeRegularTriangularSet.output )spool SquareFreeRegularTriangularSet.output )set message test on )set message auto off @@ -88996,7 +89002,7 @@ SquareFreeRegularTriangularSet(R,E,V,P) : Exports == Implementation where \section{domain SQMATRIX SquareMatrix} <>= -- matrix.spad.pamphlet SquareMatrix.input -)sys rm SquareMatrix.output +)sys rm -f SquareMatrix.output )spool SquareMatrix.output )set message test on )set message auto off @@ -89471,7 +89477,7 @@ Stack(S:SetCategory): StackAggregate S with \section{domain STREAM Stream} <>= -- stream.spad.pamphlet Stream.input -)sys rm Stream.output +)sys rm -f Stream.output )spool Stream.output )set message test on )set message auto off @@ -90419,7 +90425,7 @@ Stream(S): Exports == Implementation where \section{domain STRING String} <>= -- string.spad.pamphlet String.input -)sys rm String.output +)sys rm -f String.output )spool String.output )set message test on )set message auto off @@ -91065,7 +91071,7 @@ String(): StringCategory == IndexedString(MINSTRINGINDEX) add \section{domain STRTBL StringTable} <>= -- table.spad.pamphlet StringTable.input -)sys rm StringTable.output +)sys rm -f StringTable.output )spool StringTable.output )set message test on )set message auto off @@ -91997,7 +92003,7 @@ Switch():public == private where \section{domain SYMBOL Symbol} <>= -- symbol.spad.pamphlet Symbol.input -)sys rm Symbol.output +)sys rm -f Symbol.output )spool Symbol.output )set message test on )set message auto off @@ -93042,7 +93048,7 @@ SymmetricPolynomial(R:Ring) == PolynomialRing(R,Partition) add \section{domain TABLE Table} <>= -- table.spad.pamphlet Table.input -)sys rm Table.output +)sys rm -f Table.output )spool Table.output )set message test on )set message auto off @@ -94318,7 +94324,7 @@ TexFormat(): public == private where \section{domain TEXTFILE TextFile} <>= -- files.spad.pamphlet TextFile.input -)sys rm TextFile.output +)sys rm -f TextFile.output )spool TextFile.output )set message test on )set message auto off @@ -95419,7 +95425,7 @@ ThreeDimensionalViewport(): Exports == Implementation where viewpoint : (%,V) -> Void ++ viewpoint(v,viewpt) sets the viewpoint for the viewport. The ++ viewport record consists of the latitudal and longitudal angles, - ++ the zoom factor, the X, Y, and Z scales, and the X and Y displacements. + ++ the zoom factor, the x,y and z scales, and the x and y displacements. viewpoint : (%,I,I,F,F,F) -> Void ++ viewpoint(v,th,phi,s,dx,dy) sets the longitudinal view angle ++ to \spad{th} degrees, the latitudinal view angle to \spad{phi} @@ -97094,7 +97100,7 @@ Tuple(S:Type): CoercibleTo(PrimitiveArray S) with \section{domain ARRAY2 TwoDimensionalArray} <>= -- array2.spad.pamphlet TwoDimensionalArray.input -)sys rm TwoDimensionalArray.output +)sys rm -f TwoDimensionalArray.output )spool TwoDimensionalArray.output )set message test on )set message auto off @@ -99475,7 +99481,7 @@ UnivariateLaurentSeriesConstructor(Coef,UTS):_ \section{domain UP UnivariatePolynomial} <>= -- poly.spad.pamphlet UnivariatePolynomial.input -)sys rm UnivariatePolynomial.output +)sys rm -f UnivariatePolynomial.output )spool UnivariatePolynomial.output )set message test on )set message auto off @@ -100249,7 +100255,7 @@ UnivariatePolynomial(x:Symbol, R:Ring): coerce: Variable(x) -> % ++ coerce(x) converts the variable x to a univariate polynomial. fmecg: (%,NonNegativeInteger,R,%) -> % - ++ fmecg(p1,e,r,p2) finds X : p1 - r * X**e * p2 + ++ fmecg(p1,e,r,p2) finds x : p1 - r * x**e * p2 == SparseUnivariatePolynomial(R) add Rep:=SparseUnivariatePolynomial(R) coerce(p:%):OutputForm == outputForm(p, outputForm x) @@ -101818,7 +101824,7 @@ UnivariateTaylorSeries(Coef,var,cen): Exports == Implementation where \section{domain UNISEG UniversalSegment} <>= -- seg.spad.pamphlet UniversalSegment.input -)sys rm UniversalSegment.output +)sys rm -f UniversalSegment.output )spool UniversalSegment.output )set message test on )set message auto off @@ -102163,7 +102169,7 @@ Variable(sym:Symbol): Join(SetCategory, CoercibleTo Symbol) with \section{domain VECTOR Vector} <>= -- vector.spad.pamphlet Vector.input -)sys rm Vector.output +)sys rm -f Vector.output )spool Vector.output )set message test on )set message auto off @@ -102477,7 +102483,7 @@ Vector(R:Type): Exports == Implementation where \section{domain VOID Void} <>= -- void.spad.pamphlet Void.input -)sys rm Void.output +)sys rm -f Void.output )spool Void.output )set message test on )set message auto off @@ -102763,7 +102769,7 @@ WeightedPolynomials(R:Ring,VarSet: OrderedSet, E:OrderedAbelianMonoidSup, \section{domain WUTSET WuWenTsunTriangularSet} <>= -- triset.spad.pamphlet WuWenTsunTriangularSet.input -)sys rm WuWenTsunTriangularSet.output +)sys rm -f WuWenTsunTriangularSet.output )spool WuWenTsunTriangularSet.output )set message test on )set message auto off @@ -103594,7 +103600,7 @@ XDistributedPolynomial(vl:OrderedSet,R:Ring): XDPcat == XDPdef where \section{domain XPBWPOLY XPBWPolynomial} <>= -- xlpoly.spad.pamphlet XPBWPolynomial.input -)sys rm XPBWPolynomial.output +)sys rm -f XPBWPolynomial.output )spool XPBWPolynomial.output )set message test on )set message auto off @@ -104731,7 +104737,7 @@ XPBWPolynomial(VarSet:OrderedSet,R:CommutativeRing): XDPcat == XDPdef where \section{domain XPOLY XPolynomial} <>= -- xpoly.spad.pamphlet XPolynomial.input -)sys rm XPolynomial.output +)sys rm -f XPolynomial.output )spool XPolynomial.output )set message test on )set message auto off @@ -105065,7 +105071,7 @@ XPolynomial(R:Ring) == XRecursivePolynomial(Symbol, R) \section{domain XPR XPolynomialRing} <>= -- xpoly.spad.pamphlet XPolynomialRing.input -)sys rm XPolynomialRing.output +)sys rm -f XPolynomialRing.output )spool XPolynomialRing.output )set message test on )set message auto off diff --git a/books/bookvol10.4.pamphlet b/books/bookvol10.4.pamphlet index 039b707..b842bb7 100644 --- a/books/bookvol10.4.pamphlet +++ b/books/bookvol10.4.pamphlet @@ -2936,9 +2936,9 @@ AnnaOrdinaryDifferentialEquationPackage(): with solve:(NumericalODEProblem) -> Result ++ solve(odeProblem) is a top level ANNA function to solve numerically a ++ system of ordinary differential equations i.e. equations for the - ++ derivatives Y[1]'..Y[n]' defined in terms of X,Y[1]..Y[n], together - ++ with starting values for X and Y[1]..Y[n] (called the initial - ++ conditions), a final value of X, an accuracy requirement and any + ++ derivatives y[1]'..y[n]' defined in terms of x,y[1]..y[n], together + ++ with starting values for x and y[1]..y[n] (called the initial + ++ conditions), a final value of x, an accuracy requirement and any ++ intermediate points at which the result is required. ++ ++ It iterates over the \axiom{domains} of @@ -2958,9 +2958,9 @@ AnnaOrdinaryDifferentialEquationPackage(): with solve:(NumericalODEProblem,RT) -> Result ++ solve(odeProblem,R) is a top level ANNA function to solve numerically a ++ system of ordinary differential equations i.e. equations for the - ++ derivatives Y[1]'..Y[n]' defined in terms of X,Y[1]..Y[n], together - ++ with starting values for X and Y[1]..Y[n] (called the initial - ++ conditions), a final value of X, an accuracy requirement and any + ++ derivatives y[1]'..y[n]' defined in terms of x,y[1]..y[n], together + ++ with starting values for x and y[1]..y[n] (called the initial + ++ conditions), a final value of x, an accuracy requirement and any ++ intermediate points at which the result is required. ++ ++ It iterates over the \axiom{domains} of @@ -2978,10 +2978,10 @@ AnnaOrdinaryDifferentialEquationPackage(): with ++ ++ It then calls the resulting `best' routine. solve:(VEF,F,F,LF) -> Result - ++ solve(f,xStart,xEnd,yInitial) is a top level ANNA function to solve numerically a - ++ system of ordinary differential equations i.e. equations for the - ++ derivatives Y[1]'..Y[n]' defined in terms of X,Y[1]..Y[n], together - ++ with a starting value for X and Y[1]..Y[n] (called the initial + ++ solve(f,xStart,xEnd,yInitial) is a top level ANNA function to solve + ++ numerically a system of ordinary differential equations i.e. equations + ++ for the derivatives y[1]'..y[n]' defined in terms of x,y[1]..y[n], + ++ together with a starting value for x and y[1]..y[n] (called the initial ++ conditions) and a final value of X. A default value ++ is used for the accuracy requirement. ++ @@ -3001,10 +3001,10 @@ AnnaOrdinaryDifferentialEquationPackage(): with ++ It then calls the resulting `best' routine. solve:(VEF,F,F,LF,F) -> Result ++ solve(f,xStart,xEnd,yInitial,tol) is a top level ANNA function to solve - ++ numerically a system of ordinary differential equations, \axiom{f}, i.e. - ++ equations for the derivatives Y[1]'..Y[n]' defined in terms - ++ of X,Y[1]..Y[n] from \axiom{xStart} to \axiom{xEnd} with the initial - ++ values for Y[1]..Y[n] (\axiom{yInitial}) to a tolerance \axiom{tol}. + ++ numerically a system of ordinary differential equations, \axiom{f}, + ++ i.e. equations for the derivatives y[1]'..y[n]' defined in terms + ++ of x,y[1]..y[n] from \axiom{xStart} to \axiom{xEnd} with the initial + ++ values for y[1]..y[n] (\axiom{yInitial}) to a tolerance \axiom{tol}. ++ ++ It iterates over the \axiom{domains} of ++ \axiomType{OrdinaryDifferentialEquationsSolverCategory} contained in @@ -3021,13 +3021,13 @@ AnnaOrdinaryDifferentialEquationPackage(): with ++ ++ It then calls the resulting `best' routine. solve:(VEF,F,F,LF,EF,F) -> Result - ++ solve(f,xStart,xEnd,yInitial,G,tol) is a top level ANNA function to solve - ++ numerically a system of ordinary differential equations, \axiom{f}, i.e. - ++ equations for the derivatives Y[1]'..Y[n]' defined in terms - ++ of X,Y[1]..Y[n] from \axiom{xStart} to \axiom{xEnd} with the initial - ++ values for Y[1]..Y[n] (\axiom{yInitial}) to a tolerance \axiom{tol}. - ++ The calculation will stop if the function G(X,Y[1],..,Y[n]) evaluates to zero before - ++ X = xEnd. + ++ solve(f,xStart,xEnd,yInitial,G,tol) is a top level ANNA function to + ++ solve numerically a system of ordinary differential equations, + ++ \axiom{f}, i.e. equations for the derivatives y[1]'..y[n]' defined in + ++ terms of x,y[1]..y[n] from \axiom{xStart} to \axiom{xEnd} with the + ++ initial values for y[1]..y[n] (\axiom{yInitial}) to a tolerance + ++ \axiom{tol}. The calculation will stop if the function + ++ G(x,y[1],..,y[n]) evaluates to zero before x = xEnd. ++ ++ It iterates over the \axiom{domains} of ++ \axiomType{OrdinaryDifferentialEquationsSolverCategory} contained in @@ -3036,21 +3036,21 @@ AnnaOrdinaryDifferentialEquationPackage(): with ++ routine likely to be the most appropriate, ++ i.e. have the best \axiom{measure}. ++ - ++ The method used to perform the numerical - ++ process will be one of the routines contained in the NAG numerical - ++ Library. The function predicts the likely most effective routine - ++ by checking various attributes of the system of ODE's and calculating - ++ a measure of compatibility of each routine to these attributes. + ++ The method used to perform the numerical process will be one of the + ++ routines contained in the NAG numerical Library. The function + ++ predicts the likely most effective routine by checking various + ++ attributes of the system of ODE's and calculating a measure of + ++ compatibility of each routine to these attributes. ++ ++ It then calls the resulting `best' routine. solve:(VEF,F,F,LF,LF,F) -> Result - ++ solve(f,xStart,xEnd,yInitial,intVals,tol) is a top level ANNA function to solve - ++ numerically a system of ordinary differential equations, \axiom{f}, i.e. - ++ equations for the derivatives Y[1]'..Y[n]' defined in terms - ++ of X,Y[1]..Y[n] from \axiom{xStart} to \axiom{xEnd} with the initial - ++ values for Y[1]..Y[n] (\axiom{yInitial}) to a tolerance \axiom{tol}. - ++ The values of Y[1]..Y[n] will be output for the values of X in - ++ \axiom{intVals}. + ++ solve(f,xStart,xEnd,yInitial,intVals,tol) is a top level ANNA function + ++ to solve numerically a system of ordinary differential equations, + ++ \axiom{f}, i.e. equations for the derivatives y[1]'..y[n]' defined in + ++ terms of x,y[1]..y[n] from \axiom{xStart} to \axiom{xEnd} with the + ++ initial values for y[1]..y[n] (\axiom{yInitial}) to a tolerance + ++ \axiom{tol}. The values of y[1]..y[n] will be output for the values + ++ of x in \axiom{intVals}. ++ ++ It iterates over the \axiom{domains} of ++ \axiomType{OrdinaryDifferentialEquationsSolverCategory} contained in @@ -3067,14 +3067,14 @@ AnnaOrdinaryDifferentialEquationPackage(): with ++ ++ It then calls the resulting `best' routine. solve:(VEF,F,F,LF,EF,LF,F) -> Result - ++ solve(f,xStart,xEnd,yInitial,G,intVals,tol) is a top level ANNA function to solve - ++ numerically a system of ordinary differential equations, \axiom{f}, i.e. - ++ equations for the derivatives Y[1]'..Y[n]' defined in terms - ++ of X,Y[1]..Y[n] from \axiom{xStart} to \axiom{xEnd} with the initial - ++ values for Y[1]..Y[n] (\axiom{yInitial}) to a tolerance \axiom{tol}. - ++ The values of Y[1]..Y[n] will be output for the values of X in - ++ \axiom{intVals}. The calculation will stop if the function - ++ G(X,Y[1],..,Y[n]) evaluates to zero before X = xEnd. + ++ solve(f,xStart,xEnd,yInitial,G,intVals,tol) is a top level ANNA + ++ function to solve numerically a system of ordinary differential + ++ equations, \axiom{f}, i.e. equations for the derivatives y[1]'..y[n]' + ++ defined in terms of x,y[1]..y[n] from \axiom{xStart} to \axiom{xEnd} + ++ with the initial values for y[1]..y[n] (\axiom{yInitial}) to a + ++ tolerance \axiom{tol}. The values of y[1]..y[n] will be output for + ++ the values of x in \axiom{intVals}. The calculation will stop if the + ++ function G(x,y[1],..,y[n]) evaluates to zero before x = xEnd. ++ ++ It iterates over the \axiom{domains} of ++ \axiomType{OrdinaryDifferentialEquationsSolverCategory} contained in @@ -3091,15 +3091,16 @@ AnnaOrdinaryDifferentialEquationPackage(): with ++ ++ It then calls the resulting `best' routine. solve:(VEF,F,F,LF,EF,LF,F,F) -> Result - ++ solve(f,xStart,xEnd,yInitial,G,intVals,epsabs,epsrel) is a top level ANNA function to solve - ++ numerically a system of ordinary differential equations, \axiom{f}, i.e. - ++ equations for the derivatives Y[1]'..Y[n]' defined in terms - ++ of X,Y[1]..Y[n] from \axiom{xStart} to \axiom{xEnd} with the initial - ++ values for Y[1]..Y[n] (\axiom{yInitial}) to an absolute error + ++ solve(f,xStart,xEnd,yInitial,G,intVals,epsabs,epsrel) is a top level + ++ ANNA function to solve numerically a system of ordinary differential + ++ equations, \axiom{f}, i.e. + ++ equations for the derivatives y[1]'..y[n]' defined in terms + ++ of x,y[1]..y[n] from \axiom{xStart} to \axiom{xEnd} with the initial + ++ values for y[1]..y[n] (\axiom{yInitial}) to an absolute error ++ requirement \axiom{epsabs} and relative error \axiom{epsrel}. - ++ The values of Y[1]..Y[n] will be output for the values of X in + ++ The values of y[1]..y[n] will be output for the values of x in ++ \axiom{intVals}. The calculation will stop if the function - ++ G(X,Y[1],..,Y[n]) evaluates to zero before X = xEnd. + ++ G(x,y[1],..,y[n]) evaluates to zero before x = xEnd. ++ ++ It iterates over the \axiom{domains} of ++ \axiomType{OrdinaryDifferentialEquationsSolverCategory} contained in @@ -8358,7 +8359,7 @@ CRApackage(R:EuclideanDomain): Exports == Implementation where \section{package CYCLES CycleIndicators} <>= -- cycles.spad.pamphlet CycleIndicators.input -)sys rm CycleIndicators.output +)sys rm -f CycleIndicators.output )spool CycleIndicators.output )set message test on )set message auto off @@ -18894,7 +18895,7 @@ ErrorFunctions() : Exports == Implementation where %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{package GBEUCLID EuclideanGroebnerBasisPackage} <>= -)sys rm EuclideanGroebnerBasisPackage.output +)sys rm -f EuclideanGroebnerBasisPackage.output )spool EuclideanGroebnerBasisPackage.output )set message test on )set message auto off @@ -23076,7 +23077,7 @@ FactoredFunctions(M:IntegralDomain): Exports == Implementation where \section{package FR2 FactoredFunctions2} <>= -- fr.spad.pamphlet FactoredFunctions2.input -)sys rm FactoredFunctions2.output +)sys rm -f FactoredFunctions2.output )spool FactoredFunctions2.output )set message test on )set message auto off @@ -33638,7 +33639,7 @@ GrayCode: public == private where \section{package GBF GroebnerFactorizationPackage} <>= -- groebf.spad.pamphlet GroebnerFactorizationPackage.input -)sys rm GroebnerFactorizationPackage.output +)sys rm -f GroebnerFactorizationPackage.output )spool GroebnerFactorizationPackage.output )set message test on )set message auto off @@ -34690,7 +34691,7 @@ GroebnerInternalPackage(Dom, Expon, VarSet, Dpol): T == C where %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{package GB GroebnerPackage} <>= -)sys rm GroebnerPackage.output +)sys rm -f GroebnerPackage.output )spool GroebnerPackage.output )set message test on )set message auto off @@ -83334,7 +83335,7 @@ RealPolynomialUtilitiesPackage(TheField,ThePols) : PUB == PRIV where \section{package REALSOLV RealSolvePackage} <>= -- acplot.spad.pamphlet RealSolvePackage.input -)sys rm RealSolvePackage.output +)sys rm -f RealSolvePackage.output )spool RealSolvePackage.output )set message test on )set message auto off diff --git a/books/bookvol5.pamphlet b/books/bookvol5.pamphlet index 60c94d6..383055c 100644 --- a/books/bookvol5.pamphlet +++ b/books/bookvol5.pamphlet @@ -322,7 +322,6 @@ information is initialized. #+:akcl (setq compiler::*compile-verbose* nil) #+:akcl (setq compiler::*suppress-compiler-warnings* t) #+:akcl (setq compiler::*suppress-compiler-notes* t) -#+:akcl (system:gbc-time 0) (in-package "BOOT") (initroot) #+:akcl @@ -333,6 +332,7 @@ information is initialized. (setq |$InteractiveFrame| (|makeInitialModemapFrame|)) (setq |$printLoadMsgs| t) (setq $current-directory (get-current-directory)) + (setq *default-pathname-defaults* (pathname $current-directory)) (|loadExposureGroupData|) (|statisticsInitialization|) (|initHist|) @@ -684,6 +684,7 @@ minus any leading spaces. newwhole)))) @ + \subsection{make-absolute-filename} Prefix a filename with the {\bf AXIOM} shell variable. <>= @@ -759,14 +760,14 @@ where the [[${SYS}]] variable is the same one set at build time. <>= (defun reroot (dir) (setq $spadroot dir) - (setq $current-directory dir) (setq $directory-list (mapcar #'make-absolute-filename $relative-directory-list)) (setq $library-directory-list (mapcar #'make-absolute-filename $relative-library-directory-list)) (setq |$defaultMsgDatabaseName| (pathname (make-absolute-filename "/doc/msgs/s2-us.msgs"))) - (setq |$msgDatabaseName| ())) + (setq |$msgDatabaseName| ()) + (setq $current-directory $spadroot)) @ @@ -1081,6 +1082,372 @@ token in the string. If the string only 0 or more blanks it returns nil. (list (subseq x nonblank) ""))))) @ +\chapter{The Display Command} +\section{)display} +\begin{verbatim} + )display abbreviations + )display abbreviations [obj] + )display all + )display macros + )display mode all + )display mode [obj1 [obj2 ...]] + )display names + )display operations opname + )display properties + )display properties all + )display properties [obj1 [obj2 ...]] + )display value all + )display value [obj1 [obj2 ...]] +\end{verbatim} + +This command is used to display the contents of the workspace and +signatures of functions with a given name. A signature gives the +argument and return types of a function. + +The command +\begin{verbatim} + )display abbreviations + )display abbreviations [obj] +\end{verbatim} +will show all of the abbreviations in the current workspace. + +The command +\begin{verbatim} + )display all +\end{verbatim} +is equivalent to +\begin{verbatim} + )display properties +\end{verbatim} + +The command +\begin{verbatim} + )display macros +\end{verbatim} +will show all of the macros in the current workspace. + + +The command +\begin{verbatim} + )display names +\end{verbatim} +lists the names of all user-defined objects in the workspace. This is +useful if you do not wish to see everything about the objects and need +only be reminded of their names. + +To just show the declared mode of ``d'', issue +\begin{verbatim} + )display mode d +\end{verbatim} + +All modemaps for a given operation may be displayed by using +\begin{verbatim} + )display operations +\end{verbatim} + +A modemap is a collection of information about a particular reference +to an operation. This includes the types of the arguments and the +return value, the location of the implementation and any conditions on +the types. The modemap may contain patterns. The following displays +the modemaps for the operation {\bf complex}: +\begin{verbatim} + )d op complex +\end{verbatim} + +In addition to the modemaps for an operation the request to display +an operation will be followed by examples of the operation from each +domain. + +The commands +\begin{verbatim} + )display all + )display properties + )display properties all +\end{verbatim} +all do the same thing: show the values and types and declared modes +of all variables in the workspace. If you have defined functions, +their signatures and definitions will also be displayed. + +To show all information about a particular variable or user functions, +for example, something named ``d'', issue +\begin{verbatim} + )display properties d +\end{verbatim} + +To just show the value (and the type) of ``d'', issue +\begin{verbatim} + )display value d +\end{verbatim} +\section{Variables Used} +\subsection{defvar \$displayOptions} +The current value of \$displayOptions is + +<>= +(defvar |$displayOptions| + '(|abbreviations| |all| |macros| |modes| |names| |operations| + |properties| |types| |values|)) + +@ + +\section{Data Structures} +\section{Functions} +\subsection{defun display} +This trivial function satisfies the standard pattern of making a +user command match the name of the function which implements the +command. That command immediatly invokes a ``Spad2Cmd'' version. +<>= +(defun |display| (l) + (displaySpad2Cmd l)) + +@ + +\subsection{displaySpad2Cmd} +We process the options to the command and call the appropriate +display function. There are really only 4 display functions. +All of the other options are just subcases. + +There is a slight mismatch between the \$displayOptions list of +symbols and the options this command accepts so we have a cond +branch to clean up the option variable. + +If we fall all the way thru we use the \$displayOptions list +to construct a list of strings for the sayMessage function +and tell the user what options are available. +<>= +(defun displaySpad2Cmd (l) + (declare (special |$e|)) + (let ((|$e| |$EmptyEnvironment|) (opt (car l)) (vl (cdr l)) + option optList msg) + (if (and (pairp l) (not (eq opt '?))) + (progn + (setq option (|selectOptionLC| opt |$displayOptions| '|optionError|)) + (cond + ((eq option '|all|) + (setq l (list '|properties|)) + (setq option '|properties|)) + ((or (eq option '|modes|) (eq option '|types|)) + (setq l (cons '|type| vl)) + (setq option '|type|)) + ((eq option '|values|) + (setq l (cons '|value| vl)) + (setq option '|value|))) + (cond + ((eq option '|abbreviations|) + (if (null vl) + (|listConstructorAbbreviations|) + (dolist (v vl) (|abbQuery| (|opOf| v))))) + ((eq option '|operations|) (|displayOperations| vl)) + ((eq option '|macros|) (|displayMacros| vl)) + ((eq option '|names|) (|displayWorkspaceNames|)) + (t (|displayProperties| option l)))) + (|sayMessage| + (append + '(" )display keyword arguments are") + (mapcar #'(lambda (x) (format nil "~% ~a" x)) |$displayOptions|) + (format nil "~% or abbreviations thereof")))))) + +@ +\subsection{defun displayOperations} +This function takes a list of operation names. If the list is null +we query the user to see if they want all operations printed. Otherwise +we print the information for the requested symbols. +<>= +(defun |displayOperations| (l) + (if l + (dolist (op l) (|reportOpSymbol| op)) + (if (yesanswer) + (dolist (op (|allOperations|)) (|reportOpSymbol| op)) + (|sayKeyedMsg| 's2iz0059 nil)))) + +@ +\subsection{defun yesanswer} +This is a trivial function to simplify the logic of displaySpad2Cmd. +If the user didn't supply an argument to the )display op command +we ask if they wish to have all information about all Axiom operations +displayed. If the answer is either Y or YES we return true else nil. +<>= +(defun yesanswer () + (memq (string2id-n (upcase (|queryUserKeyedMsg| 's2iz0058 nil)) 1) '(y yes))) + +@ + +\subsection{defun displayMacros} +;displayMacros names == +; imacs := getInterpMacroNames() +; pmacs := getParserMacroNames() +; macros := +; null names => APPEND (imacs, pmacs) +; names +; macros := REMDUP macros +; null macros => sayBrightly '" There are no Axiom macros." +; -- first do user defined ones +; first := true +; for macro in macros repeat +; macro in pmacs => +; if first then +; sayBrightly ['%l,'"User-defined macros:"] +; first := NIL +; displayParserMacro macro +; macro in imacs => 'iterate +; sayBrightly ([" ",'%b, macro, '%d, " is not a known Axiom macro."]) +; -- now system ones +; first := true +; for macro in macros repeat +; macro in imacs => +; macro in pmacs => 'iterate +; if first then +; sayBrightly ['%l,'"System-defined macros:"] +; first := NIL +; displayMacro macro +; macro in pmacs => 'iterate +; NIL +<>= +(defun |displayMacros| (names) + (let (imacs pmacs macros first) + (setq imacs (|getInterpMacroNames|)) + (setq pmacs (|getParserMacroNames|)) + (if names + (setq macros names) + (setq macros (append imacs pmacs))) + (setq macros (remdup macros)) + (cond + ((null macros) (|sayBrightly| " There are no Axiom macros.")) + (t + (setq first t) + (do ((t0 macros (cdr t0)) (macro nil)) + ((or (atom t0) (progn (setq macro (car t0)) nil)) nil) + (seq + (exit + (cond + ((|member| macro pmacs) + (cond + (first (|sayBrightly| (cons '|%l| (cons "User-defined macros:" nil))) (setq first nil))) + (|displayParserMacro| macro)) + ((|member| macro imacs) '|iterate|) + (t (|sayBrightly| (cons " " (cons '|%b| (cons macro (cons '|%d| (cons " is not a known Axiom macro." nil))))))))))) + (setq first t) + (do ((t1 macros (cdr t1)) (macro nil)) + ((or (atom t1) (progn (setq macro (car t1)) nil)) nil) + (seq + (exit + (cond + ((|member| macro imacs) + (cond + ((|member| macro pmacs) '|iterate|) + (t + (cond + (first + (|sayBrightly| + (cons '|%l| + (cons "System-defined macros:" nil))) (setq first nil))) + (|displayMacro| macro)))) + ((|member| macro pmacs) '|iterate|))))) + nil)))) + +@ + +\subsection{sayExample} +This function expects 2 arguments, the documentation string and +the name of the operation. It searches the documentation string for +\verb|++X| lines. These lines are examples lines for functions. +They look like ordinary \verb|++| comments and fit into the ordinary +comment blocks. So, for example, in the plot.spad.pamphlet file we +find the following function signature: +\begin{verbatim} + plot: (F -> F,R) -> % + ++ plot(f,a..b) plots the function \spad{f(x)} + ++ on the interval \spad{[a,b]}. + ++ + ++X fp:=(t:DFLOAT):DFLOAT +-> sin(t) + ++X plot(fp,-1.0..1.0)$PLOT +\end{verbatim} +This function splits out and prints the lines that begin with \verb|++X|. + +A minor complication of printing the examples is that the lines have +been processed into internal compiler format. Thus the lines that read: +\begin{verbatim} + ++X fp:=(t:DFLOAT):DFLOAT +-> sin(t) + ++X plot(fp,-1.0..1.0)$PLOT +\end{verbatim} +are actually stored as one long line containing the example lines +\begin{verbatim} +"\\indented{1}{plot(\\spad{f},{}a..\\spad{b}) plots the function + \\spad{f(x)}} \\indented{1}{on the interval \\spad{[a,{}b]}.} + \\blankline + \\spad{X} fp:=(t:DFLOAT):DFLOAT +-> sin(\\spad{t}) + \\spad{X} plot(\\spad{fp},{}\\spad{-1}.0..1.0)\\$PLOT" +\end{verbatim} + +So when we have an example line starting with ++X, it gets +converted to the compiler to \verb|\spad{X}|. So each +example line is delimited by \verb|\spad{X}|. + +The compiler also removes the newlines so +if there is a subsequent \verb|\spad{X}| in the docstring +then it implies multiple example lines and we loop over them, +splitting them up at the delimiter. + +If there is only one then we clean it up and print it. +<>= +(defun sayExample (docstring) + (let (line point) + (when (setq point (search "spad{X}" docstring)) + (setq line (subseq docstring (+ point 8))) + (do ((mark (search "spad{X}" line) (search "spad{X}" line))) + ((null mark)) + (princ (cleanupLine (subseq line (+ mark 8)))) + (|sayNewLine|) + (setq line (subseq line (+ mark 8)))) + (princ (cleanupLine line)) + (|sayNewLine|) + (|sayNewLine|)))) + +@ +\subsection{cleanupLine} +This function expects example lines in internal format that has been +partially processed to remove the prefix. Thus we get lines that look +like: +\begin{verbatim} + fp:=(t:DFLOAT):DFLOAT +-> sin(\\spad{t}) + plot(\\spad{fp},{}\\spad{-1}.0..1.0)\\$PLOT +\end{verbatim} + +It removes all instances of \verb|{}|, and \verb|\|, and unwraps the +\verb|spad{}| call, leaving only the argument. + +We return lines that look like: +\begin{verbatim} + fp:=(t:DFLOAT):DFLOAT +-> sin(t) + plot(fp,-1.0..1.0)$PLOT +\end{verbatim} +which is hopefully exactly what the user wrote. + +The compiler inserts \verb|{}| as a space so we remove it. +We remove all of the \verb|\| characters. +We remove all of the \verb|spad{...}| delimiters which will +occur around other spad variables. Technically we should +search recursively for the matching delimiter rather than the +next brace but the problem does not arise in practice. +<>= +(defun cleanupLine (line) + (do ((mark (search "{}" line) (search "{}" line))) + ((null mark)) + (setq line (concatenate 'string (subseq line 0 mark) (subseq line (+ mark 2))))) + (do ((mark (search "\\" line) (search "\\" line))) + ((null mark)) + (setq line (concatenate 'string (subseq line 0 mark) (subseq line (+ mark 1))))) + (do ((mark (search "spad{" line) (search "spad{" line))) + ((null mark)) + (let (left point mid right) + (setq left (subseq line 0 mark)) + (setq point (search "}" line :start2 mark)) + (setq mid (subseq line (+ mark 5) point)) + (setq right (subseq line (+ point 1))) + (setq line (concatenate 'string left mid right)))) + line) + +@ + \chapter{The History Mechanism} \section{)history} \index{ugSysCmdhistory} @@ -3688,159 +4055,97 @@ prompt. {\tt )history} \index{ugSysCmdhistory} and {\tt )set} \index{ugSysCmdset}. -@ -\section{Variables Used} -The frame mechanism uses several dollar variables. -\subsection{Primary variables} -Primary variables are those which exist solely to make the frame -mechanism work. - -The \$interpreterFrameName contains a symbol which is the name -of the current frame in use. - -The \$interpreterFrameRing contains a list of all of the existing -frames. The first frame on the list is the ``current'' frame. When -AXIOMsys is started directly there is only one frame named ``initial''. - -If the system is started under sman (using the axiom shell script, -for example), there are two frames, ``initial'' and ``frame0''. In -this case, ``frame0'' is the current frame. This can cause subtle -problems because functions defined in the axiom initialization file -(.axiom.input) will be defined in frame ``initial'' but the current -frame will be ``frame0''. They will appear to be undefined. However, -if the user does ``)frame next'' they can switch to the ``initial'' -frame and see the functions correctly defined. - -The \$frameMessages variable controls when frame messages will be -displayed. The variable is initially NIL. It can be set on (T) or off (NIL) -using the system command: +\subsection{defun frameName} \begin{verbatim} - )set message frame on | off +frameName(frame) == CAR frame \end{verbatim} -Setting frame messages on will output a line detailing the -current frame after every output is complete. - -\subsection{Used variables} - -The frame collects and uses a few top level variables. These are: -\$InteractiveFrame, \$IOindex, \$HiFiAccess, \$HistList, \$HistListLen, -\$HistListAct, \$HistRecord, \$internalHistoryTable, and \$localExposureData. - -These variables can also be changed by the frame mechanism when the user -requests changing to a different frame. - -\section{Data Structures} -\subsection{Frames and the Interpreter Frame Ring} - -Axiom has the notion of ``frames''. A frame is a data structure which -holds all the vital data from an Axiom session. There can be multiple -frames and these live in a top-level variable called -\$interpreterFrameRing. This variable holds a circular list of frames. -The parts of a frame and their initial, default values are: - -\begin{verbatim} - $interpreterFrameName a string, named on creation - $InteractiveFrame (list (list nil)) - $IOindex an integer, 1 - $HiFiAccess $HiFiAccess, see the variable description - $HistList $HistList, see the variable description - $HistListLen $HistListLen, see the variable description - $HistListAct $HistListAct, see the variable description - $HistRecord $HistRecord, see the variable description - $internalHistoryTable nil - $localExposureData a copy of $localExposureData -\end{verbatim} - -\section{Accessor Functions} -These could be macros but we wish to export them to the API code -in the algebra so we keep them as functions. -\subsection{0th Frame Component -- frameName} <>= -(defun frameName (frame) +(defun |frameName| (frame) (car frame)) @ -\subsection{1st Frame Component -- frameInteractive} -<>= -(defun frameInteractive (frame) - (nth 1 frame)) - -@ -\subsection{2nd Frame Component -- frameIOIndex} -<>= -(defun frameIOIndex (frame) - (nth 2 frame)) - -@ -\subsection{3rd Frame Component -- frameHiFiAccess} -<>= -(defun frameHiFiAccess (frame) - (nth 3 frame)) - -@ -\subsection{4th Frame Component -- frameHistList} -<>= -(defun frameHistList (frame) - (nth 4 frame)) - -@ -\subsection{5th Frame Component -- frameHistListLen} -<>= -(defun frameHistListLen (frame) - (nth 5 frame)) - -@ -\subsection{6th Frame Component -- frameHistListAct} -<>= -(defun frameHistListAct (frame) - (nth 6 frame)) - -@ -\subsection{7th Frame Component -- frameHistRecord} -<>= -(defun frameHistRecord (frame) - (nth 7 frame)) - -@ -\subsection{8th Frame Component -- frameHistoryTable} -<>= -(defun frameHistoryTable (frame) - (nth 8 frame)) - -@ -\subsection{9th Frame Component -- frameExposureData} -<>= -(defun frameExposureData (frame) - (nth 9 frame)) - -@ - +\section{Variables Used} +\section{Data Structures} \section{Functions} -\subsection{Initializing the Interpreter Frame Ring} - -Now that we know what a frame looks like we need a function to -initialize the list of frames. This function sets the initial frame -name to ``initial'' and creates a list of frames containing an empty -frame. This list is the interpreter frame ring and is not actually -circular but is managed as a circular list. - -As a final step we update the world from this frame. This has the -side-effect of resetting all the important global variables to their -initial values. - -<>= -(defun |initializeInterpreterFrameRing| () - (setq |$interpreterFrameName| '|initial|) - (setq |$interpreterFrameRing| - (list (|emptyInterpreterFrame| |$interpreterFrameName|))) - (|updateFromCurrentInterpreterFrame|) nil) +\subsection{defun frameNames} +\begin{verbatim} +frameNames() == [frameName f for f in $interpreterFrameRing] +\end{verbatim} +<>= +(defun |frameNames| () + (prog () + (return + (seq + (prog (tmp0) + (spadlet tmp0 nil) + (return + (do ((tmp1 |$interpreterFrameRing| (cdr tmp1)) (f nil)) + ((or (atom tmp1) + (progn (setq f (car tmp1)) nil)) + (nreverse0 tmp0)) + (seq + (exit + (setq tmp0 (cons (|frameName| f) tmp0))))))))))) @ +\subsection{defun frameEnvironment} +\begin{verbatim} +frameEnvironment fname == + -- extracts the environment portion of a frame + -- if fname is not a valid frame name then the empty environment + -- is returned + fname = frameName first $interpreterFrameRing => $InteractiveFrame + ifr := rest $interpreterFrameRing + e := LIST LIST NIL + while ifr repeat + [f,:ifr] := ifr + if fname = frameName f then + e := CADR f + ifr := NIL + e +\end{verbatim} +<>= +(defun |frameEnvironment| (fname) + (prog + (tmp1 f e ifr) + (return + (seq + (cond + ((boot-equal fname (|frameName| (CAR |$interpreterFrameRing|))) + |$InteractiveFrame|) + (t + (spadlet ifr (cdr |$interpreterFrameRing|)) + (spadlet e (list (list nil))) + (do () + ((null ifr) nil) + (seq + (exit + (progn + (spadlet tmp1 ifr) + (spadlet f (car tmp1)) + (spadlet ifr (cdr tmp1)) + (cond + ((boot-equal fname (|frameName| f)) + (spadlet e (cadr f)) + (spadlet ifr nil)) + (t nil)))))) e)))))) -The initial values of an empty frame are created here. This function -returns a single frame that will be placed in the frame ring. - -\subsection{Creating an Empty Frame} +@ +\subsection{defun emptyInterpreterFrame} +\begin{verbatim} +emptyInterpreterFrame(name) == + LIST(name, -- frame name + LIST LIST NIL, -- environment + 1, -- $IOindex + $HiFiAccess, -- $HiFiAccess + $HistList, -- $HistList + $HistListLen, -- $HistListLen + $HistListAct, -- $HistListAct + $HistRecord, -- $HistRecord + NIL, -- $internalHistoryTable + COPY_-SEQ $localExposureDataDefault -- $localExposureData + ) +\end{verbatim} <>= (defun |emptyInterpreterFrame| (name) (list name @@ -3855,12 +4160,21 @@ returns a single frame that will be placed in the frame ring. (copy-seq |$localExposureDataDefault|))) @ -\subsection{Collecting up the Environment into a Frame} - -We can collect up all the current environment information into -one frame element with this call. It creates a list of the current -values of the global variables and returns this as a frame element. - +\subsection{defun createCurrentInterpreterFrame} +\begin{verbatim} +createCurrentInterpreterFrame() == + LIST($interpreterFrameName, -- frame name + $InteractiveFrame, -- environment + $IOindex, -- $IOindex + $HiFiAccess, -- $HiFiAccess + $HistList, -- $HistList + $HistListLen, -- $HistListLen + $HistListAct, -- $HistListAct + $HistRecord, -- $HistRecord + $internalHistoryTable, -- $internalHistoryTable + $localExposureData -- $localExposureData + ) +\end{verbatim} <>= (defun |createCurrentInterpreterFrame| () (list @@ -3876,94 +4190,114 @@ values of the global variables and returns this as a frame element. |$localExposureData|)) @ -\subsection{Updating from the Current Frame} - -The frames are kept on a circular list. The first element on that -list is known as ``the current frame''. This will initialize all -of the interesting interpreter data structures from that frame. - +\subsection{defun updateFromCurrentInterpreterFrame} +\begin{verbatim} +updateFromCurrentInterpreterFrame() == + [$interpreterFrameName, _ + $InteractiveFrame, _ + $IOindex, _ + $HiFiAccess, _ + $HistList, _ + $HistListLen, _ + $HistListAct, _ + $HistRecord, _ + $internalHistoryTable, _ + $localExposureData _ + ] := first $interpreterFrameRing + if $frameMessages then + sayMessage ['" Current interpreter frame is called",:bright + $interpreterFrameName] + NIL +\end{verbatim} <>= (defun |updateFromCurrentInterpreterFrame| () - (let (tmp1) - (setq tmp1 (first |$interpreterFrameRing|)) - (setq |$interpreterFrameName| (nth 0 tmp1)) - (setq |$InteractiveFrame| (nth 1 tmp1)) - (setq |$IOindex| (nth 2 tmp1)) - (setq |$HiFiAccess| (nth 3 tmp1)) - (setq |$HistList| (nth 4 tmp1)) - (setq |$HistListLen| (nth 5 tmp1)) - (setq |$HistListAct| (nth 6 tmp1)) - (setq |$HistRecord| (nth 7 tmp1)) - (setq |$internalHistoryTable| (nth 8 tmp1)) - (setq |$localExposureData| (nth 9 tmp1)) - (when |$frameMessages| - (|sayMessage| - (cons " Current interpreter frame is called" |$interpreterFrameName|))))) - -@ - -\subsection{Creating a List of all of the Frame Names} - -This function simply walks across the frame in the frame ring and -returns a list of the name of each frame. - -<>= -(defun |frameNames| () - (let (result) - (dolist (frame |$interpreterFrameRing|) - (push (frameName frame) result)) - (nreverse result))) + (prog (tmp1) + (return + (progn + (spadlet tmp1 (CAR |$interpreterFrameRing|)) + (spadlet |$interpreterFrameName| (car tmp1)) + (spadlet |$InteractiveFrame| (cadr tmp1)) + (spadlet |$IOindex| (caddr tmp1)) + (spadlet |$HiFiAccess| (cadddr tmp1)) + (spadlet |$HistList| (car (cddddr tmp1))) + (spadlet |$HistListLen| (cadr (cddddr tmp1))) + (spadlet |$HistListAct| (caddr (cddddr tmp1))) + (spadlet |$HistRecord| (cadddr (cddddr tmp1))) + (spadlet |$internalHistoryTable| (car (cddddr (cddddr tmp1)))) + (spadlet |$localExposureData| (cadr (cddddr (cddddr tmp1)))) + (when |$frameMessages| + (|sayMessage| + (cons + (makestring " Current interpreter frame is called") + (|bright| |$interpreterFrameName|)))) + nil)))) @ -\subsection{Find a Frame in the Frame Ring by Name} - -Each frame contains its name as the 0th element. We simply walk all -the frames and if we find one we return it. - +\subsection{defun findFrameInRing} +\begin{verbatim} +findFrameInRing(name) == + val := NIL + for frame in $interpreterFrameRing repeat + CAR frame = name => + val := frame + return frame + val +\end{verbatim} <>= (defun |findFrameInRing| (name) - (block () - (dolist (frame |$interpreterFrameRing|) - (when (eq (frameName frame) name) (return frame))))) - -@ -\subsection{Get Named Frame Environment (aka Interactive)} - -If the frame is found we return the environment portion of the frame -otherwise we construct an empty environment and return it. - -<>= -(defun |frameEnvironment| (fname) - (let ((frame (|findFrameInRing| fname))) - (if frame - (frameInteractive frame) - (list (list nil))))) + (prog (val) + (return + (seq + (progn + (spadlet val nil) + (seq + (do ((tmp0 |$interpreterFrameRing| (cdr tmp0)) (frame nil)) + ((or (atom tmp0) + (progn (setq frame (car tmp0)) nil)) + nil) + (seq + (exit + (when (boot-equal (CAR frame) name) + (exit + (progn + (spadlet val frame) + (return frame))))))) + (exit val))))))) @ -\subsection{Update the Current Interpreter Frame} - -This function collects the normal contents of the world into a -frame object, places it first on the frame list, and then sets -the current values of the world from the frame object. - +\subsection{defun updateCurrentInterpreterFrame} +\begin{verbatim} +updateCurrentInterpreterFrame() == + RPLACA($interpreterFrameRing,createCurrentInterpreterFrame()) + updateFromCurrentInterpreterFrame() + NIL +\end{verbatim} <>= (defun |updateCurrentInterpreterFrame| () - (rplaca |$interpreterFrameRing| (|createCurrentInterpreterFrame|)) - (|updateFromCurrentInterpreterFrame|) - nil) + (progn + (rplaca |$interpreterFrameRing| (|createCurrentInterpreterFrame|)) + (|updateFromCurrentInterpreterFrame|) + nil)) @ -\subsection{defun nextInterpreterFrame} - -This function updates the current frame to make sure all of the -current information is recorded. If there are more frame elements -in the list then this will destructively move the current frame -to the end of the list, that is, assume the frame list reads (1 2 3) -this function will destructively change it to (2 3 1). - -Note: the nconc2 function destructively inserts the second list at the -end of the first. +\subsection{defun initializeInterpreterFrameRing} +\begin{verbatim} +initializeInterpreterFrameRing() == + $interpreterFrameName := 'initial + $interpreterFrameRing := [emptyInterpreterFrame($interpreterFrameName)] + updateFromCurrentInterpreterFrame() + NIL +\end{verbatim} +<>= +(defun |initializeInterpreterFrameRing| () + (progn + (spadlet |$interpreterFrameName| '|initial|) + (spadlet |$interpreterFrameRing| + (cons (|emptyInterpreterFrame| |$interpreterFrameName|) nil)) + (|updateFromCurrentInterpreterFrame|) nil)) +@ +\subsection{defun nextInterpreterFrame} \begin{verbatim} nextInterpreterFrame() == updateCurrentInterpreterFrame() @@ -3974,12 +4308,18 @@ nextInterpreterFrame() == \end{verbatim} <>= (defun |nextInterpreterFrame| () - (|updateCurrentInterpreterFrame|) - (when (cdr |$interpreterFrameRing|) - (setq |$interpreterFrameRing| - (nconc2 (cdr |$interpreterFrameRing|) - (list (car |$interpreterFrameRing|)))) - (|updateFromCurrentInterpreterFrame|))) + (progn + (|updateCurrentInterpreterFrame|) + (cond + ((null (cdr |$interpreterFrameRing|)) + nil) + (t + (spadlet |$interpreterFrameRing| + (nconc2 + (cdr |$interpreterFrameRing|) + (cons + (car |$interpreterFrameRing|) nil))) + (|updateFromCurrentInterpreterFrame|))))) @ \subsection{defun changeToNamedInterpreterFrame} @@ -4062,7 +4402,7 @@ addNewInterpreterFrame(name) == nil) (seq (exit - (when (boot-equal name (frameName f)) + (when (boot-equal name (|frameName| f)) (exit (|throwKeyedMsg| 'S2IZ0019 ; existing frame with same name (cons name nil))))))) @@ -4117,7 +4457,7 @@ closeInterpreterFrame(name) == (seq (exit (cond - ((or found (nequal name (frameName f))) + ((or found (nequal name (|frameName| f))) (spadlet ifr (cons f ifr))) (t (spadlet found t)))))) @@ -4155,7 +4495,7 @@ displayFrameNames() == (exit (setq tmp0 (append tmp0 (cons '|%l| - (cons (makestring " ") (|bright| (frameName f)))))))))))) + (cons (makestring " ") (|bright| (|frameName| f)))))))))))) (|sayKeyedMsg| 'S2IZ0024 (cons fs nil))))))) ; frame names are ... @ @@ -4211,7 +4551,7 @@ importFromFrame args == (cond ((null (|member| fname (|frameNames|))) (|throwKeyedMsg| 'S2IZ0074 (cons fname nil))) ; not frame name - ((boot-equal fname (frameName (car |$interpreterFrameRing|))) + ((boot-equal fname (|frameName| (car |$interpreterFrameRing|))) (|throwKeyedMsg| 'S2IZ0075 NIL)) ; cannot import from curr frame (t (spadlet fenv (|frameEnvironment| fname)) @@ -5560,27 +5900,6 @@ load the file \verb|exposed.lsp| to set up the exposure group information. @ -\chapter{Support Functions from Lisp} -\pagehead{current-directory}{current-directory} -<>= -(defvar $current-directory "") - -@ -\pagehead{get-current-directory}{get-current-directory} -This function returns a string representing the current directory. -This is maintained in the \$current-directory variable. It is called -from the \fnref{restart} function. -<>= -#+:cmu -(defun get-current-directory () - (namestring (extensions::default-directory))) - -#+(or :akcl :gcl) -(defun get-current-directory () - (namestring (truename ""))) - -@ - \chapter{The Interpreter} <>= (in-package "BOOT") @@ -5593,6 +5912,7 @@ from the \fnref{restart} function. <> <> <> +<> <> <> <> @@ -5602,7 +5922,11 @@ from the \fnref{restart} function. <> <> <> +<> <> +<> +<> +<> <> @@ -5610,20 +5934,10 @@ from the \fnref{restart} function. <> <> <> -<> -<> -<> -<> -<> -<> -<> -<> -<> <> <> <> -<> <> <> @@ -5684,6 +5998,7 @@ from the \fnref{restart} function. <> <> +<> <> <> <> @@ -5722,6 +6037,8 @@ from the \fnref{restart} function. <> <> +<> + @ \chapter{The Global Variables} \section{Star Global Variables} diff --git a/readme b/readme index ae718f3..a468845 100644 --- a/readme +++ b/readme @@ -1,5 +1,15 @@ "What matters the most is what you do for free" -- John Gorka +"...even more important, for the progress of mathematics in the computer + age, is the beaver, who will build the needed infrastructure of computer + mathematics, that would eventually enable us to solve many outstanding + open problems, and many new ones. Consequently, the developers of computer + algebra systems, and creators of algorithms, are even more important than + both birds and frogs." --Doron Zeilberger + (http://www.math.rutgers.edu/~zeilberg/Opinion95.html) + + + You've unpacked the Axiom source code to some directory. In this document we'll call that directory /home/me/axiom. Note that the path cannot contain uppercase characters or spaces. This is a porting diff --git a/src/interp/format.boot.pamphlet b/src/interp/format.boot.pamphlet index de87ba6..d8fabbe 100644 --- a/src/interp/format.boot.pamphlet +++ b/src/interp/format.boot.pamphlet @@ -246,98 +246,9 @@ reportOpSymbol op1 == sayBrightly ['"Examples of ",op," from ",adom] sayNewLine() for export in docs repeat - sayExample(CADR(export),op) + SAYEXAMPLE(CADR(export)) nil -@ -\subsection{sayExample} -This function expects 2 arguments, the documentation string and -the name of the operation. It searches the documentation string for -\verb|++X| lines. These lines are examples lines for functions. -They look like ordinary \verb|++| comments and fit into the ordinary -comment blocks. So, for example, in the plot.spad.pamphlet file we -find the following function signature: -\begin{verbatim} - plot: (F -> F,R) -> % - ++ plot(f,a..b) plots the function \spad{f(x)} - ++ on the interval \spad{[a,b]}. - ++ - ++X fp:=(t:DFLOAT):DFLOAT +-> sin(t) - ++X plot(fp,-1.0..1.0)$PLOT -\end{verbatim} -This function splits out and prints the lines that begin with \verb|++X|. - -A minor complication of printing the examples is that the lines have -been processed into internal compiler format. Thus the lines that read: -\begin{verbatim} - ++X fp:=(t:DFLOAT):DFLOAT +-> sin(t) - ++X plot(fp,-1.0..1.0)$PLOT -\end{verbatim} -are actually stored as one long line containing the example lines -\begin{verbatim} -"\\indented{1}{plot(\\spad{f},{}a..\\spad{b}) plots the function - \\spad{f(x)}} \\indented{1}{on the interval \\spad{[a,{}b]}.} - \\blankline - \\spad{X} fp:=(t:DFLOAT):DFLOAT +-> sin(\\spad{t}) - \\spad{X} plot(\\spad{fp},{}\\spad{-1}.0..1.0)\\$PLOT" -\end{verbatim} - -This function finds examples and strips off the prefix \verb|\\spad{X}| -from the stored form and calls cleanupLine to get rid of the other noise. -<<*>>= -sayExample(docstring,op) == - point := SEARCH('"{X}",docstring) - point => - line := SUBSEQ(docstring,point+3) - while (mark:=SEARCH('"{X}",line)) repeat - mark > 0 => - PRINC cleanupLine (SUBSEQ(line,0,mark-6)) - sayNewLine() - line := SUBSEQ(line,mark+3) - PRINC cleanupLine(line) - sayNewLine() - sayNewLine() - -@ -\subsection{cleanupLine} -This function expects example lines in internal format that has been -partially processed to remove the prefix. Thus we get lines that look -like: -\begin{verbatim} - fp:=(t:DFLOAT):DFLOAT +-> sin(\\spad{t}) - plot(\\spad{fp},{}\\spad{-1}.0..1.0)\\$PLOT -\end{verbatim} - -It removes all instances of \verb|{}|, and \verb|\|, and unwraps the -\verb|spad{}| call, leaving only the argument. - -We return lines that look like: -\begin{verbatim} - fp:=(t:DFLOAT):DFLOAT +-> sin(t) - plot(fp,-1.0..1.0)$PLOT -\end{verbatim} -which is hopefully exactly what the user wrote. - -<<*>>= -cleanupLine(line) == - while (point := SEARCH('"{}",line)) repeat - point => - left := SUBSEQ(line,0,point) - right := SUBSEQ(line,point+2) - line := CONCATENATE('STRING,left,right) - while (point := SEARCH('"\",line)) repeat - point => - left := SUBSEQ(line,0,point) - right := SUBSEQ(line,point+1) - line := CONCATENATE('STRING,left,right) - while (point := SEARCH('"spad{",line)) repeat - left := SUBSEQ(line,0,point) - mark := SEARCH('"}",line) - mid := SUBSEQ(line,point+5,mark) - right := SUBSEQ(line,mark+1) - line := CONCATENATE('STRING,left,mid,right) - line - formatOpType (form:=[op,:argl]) == null argl => unabbrev op form2String [unabbrev op, :argl]