diff options
author | dos-reis <gdr@axiomatics.org> | 2008-09-18 14:26:35 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2008-09-18 14:26:35 +0000 |
commit | 4126dc2b32ee818635e57990b3e6f647b9a7dbcb (patch) | |
tree | 63a1bab1ef8e5c3b301683069c6e42d6076c5cf8 | |
parent | c7922bf127eac4b203fc3c36b0ae1d0f9d279f54 (diff) | |
download | open-axiom-4126dc2b32ee818635e57990b3e6f647b9a7dbcb.tar.gz |
* interp/c-util.boot (displayAmbiguousSignatures): New.
(ambiguousSignatureError): Likewise.
* interp/define.boot (hasSigInTargetCategory): Use it to reject
ambiguous lhs of a definition.
* interp/lisplib.boot (leaveIfErrors): Fix typo.
* algebra/aggcat.spad.pamphlet: Disambiguate definitions.
* algebra/card.spad.pamphlet: Likewise.
* algebra/dhmatrix.spad.pamphlet: Likewise.
* algebra/divisor.spad.pamphlet: Likewise.
* algebra/expexpan.spad.pamphlet: Likewise.
* algebra/ffcat.spad.pamphlet: Likewise.
* algebra/ffcg.spad.pamphlet: Likewise.
* algebra/ffnb.spad.pamphlet: Likewise.
* algebra/ffp.spad.pamphlet: Likewise.
* algebra/generic.spad.pamphlet: Likewise.
* algebra/groebf.spad.pamphlet: Likewise.
* algebra/modring.spad.pamphlet: Likewise.
* algebra/moebius.spad.pamphlet: Likewise.
* algebra/mts.spad.pamphlet: Likewise.
* algebra/naalgc.spad.pamphlet: Likewise.
* algebra/ore.spad.pamphlet: Likewise.
* algebra/outform.spad.pamphlet: Likewise.
* algebra/pf.spad.pamphlet: Likewise.
* algebra/poly.spad.pamphlet: Likewise.
* algebra/polycat.spad.pamphlet: Likewise.
* algebra/prtition.spad.pamphlet: Likewise.
* algebra/radix.spad.pamphlet: Likewise.
* algebra/rep2.spad.pamphlet: Likewise.
* algebra/stream.spad.pamphlet: Likewise.
* algebra/string.spad.pamphlet: Likewise.
* algebra/tree.spad.pamphlet: Likewise.
* algebra/triset.spad.pamphlet: Likewise.
* algebra/view2D.spad.pamphlet: Likewise.
* algebra/sf.spad.pamphlet: Remove signature for hash.
* algebra/si.spad.pamphlet: Likewise.
34 files changed, 213 insertions, 53 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 43f5e6c1..73022569 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,41 @@ +2008-09-18 Gabriel Dos Reis <gdr@cs.tamu.edu> + + * interp/c-util.boot (displayAmbiguousSignatures): New. + (ambiguousSignatureError): Likewise. + * interp/define.boot (hasSigInTargetCategory): Use it to reject + ambiguous lhs of a definition. + * interp/lisplib.boot (leaveIfErrors): Fix typo. + * algebra/aggcat.spad.pamphlet: Disambiguate definitions. + * algebra/card.spad.pamphlet: Likewise. + * algebra/dhmatrix.spad.pamphlet: Likewise. + * algebra/divisor.spad.pamphlet: Likewise. + * algebra/expexpan.spad.pamphlet: Likewise. + * algebra/ffcat.spad.pamphlet: Likewise. + * algebra/ffcg.spad.pamphlet: Likewise. + * algebra/ffnb.spad.pamphlet: Likewise. + * algebra/ffp.spad.pamphlet: Likewise. + * algebra/generic.spad.pamphlet: Likewise. + * algebra/groebf.spad.pamphlet: Likewise. + * algebra/modring.spad.pamphlet: Likewise. + * algebra/moebius.spad.pamphlet: Likewise. + * algebra/mts.spad.pamphlet: Likewise. + * algebra/naalgc.spad.pamphlet: Likewise. + * algebra/ore.spad.pamphlet: Likewise. + * algebra/outform.spad.pamphlet: Likewise. + * algebra/pf.spad.pamphlet: Likewise. + * algebra/poly.spad.pamphlet: Likewise. + * algebra/polycat.spad.pamphlet: Likewise. + * algebra/prtition.spad.pamphlet: Likewise. + * algebra/radix.spad.pamphlet: Likewise. + * algebra/rep2.spad.pamphlet: Likewise. + * algebra/stream.spad.pamphlet: Likewise. + * algebra/string.spad.pamphlet: Likewise. + * algebra/tree.spad.pamphlet: Likewise. + * algebra/triset.spad.pamphlet: Likewise. + * algebra/view2D.spad.pamphlet: Likewise. + * algebra/sf.spad.pamphlet: Remove signature for hash. + * algebra/si.spad.pamphlet: Likewise. + 2008-09-18 Bill Page <bill.page@newsynthesis.org> Gabriel Dos Reis <gdr@cs.tamu.edu> diff --git a/src/algebra/aggcat.spad.pamphlet b/src/algebra/aggcat.spad.pamphlet index 42a4f3fd..86d91cba 100644 --- a/src/algebra/aggcat.spad.pamphlet +++ b/src/algebra/aggcat.spad.pamphlet @@ -1050,6 +1050,9 @@ IndexedAggregate(Index: SetCategory, Entry: Type): Category == import SetCategory import KeyedDictionary import IndexedAggregate +import Boolean +import OutputForm +import List )abbrev category TBAGG TableAggregate ++ Author: Michael Monagan, Stephen Watt; revised by Manuel Bronstein and Richard Jenks ++ Date Created: August 87 through August 88 @@ -1098,7 +1101,7 @@ TableAggregate(Key:SetCategory, Entry:SetCategory): Category == (r := search(k, t)) case Entry => r::Entry e - map_!(f, t) == + map_!(f: Entry->Entry, t: %) == for k in keys t repeat t.k := f t.k t diff --git a/src/algebra/card.spad.pamphlet b/src/algebra/card.spad.pamphlet index ce908e9c..e6ffb393 100644 --- a/src/algebra/card.spad.pamphlet +++ b/src/algebra/card.spad.pamphlet @@ -11,6 +11,8 @@ \eject \section{domain CARD CardinalNumber} <<domain CARD CardinalNumber>>= +import Boolean +import NonNegativeInteger )abbrev domain CARD CardinalNumber ++ Author: S.M. Watt ++ Date Created: June 1986 @@ -133,7 +135,7 @@ CardinalNumber: Join(OrderedSet, AbelianMonoid, Monoid, finite? x => [FINord, n*x.ival] n = 0 => 0 x - x**y == + (x: %) ** (y: %) == y = 0 => x ~= 0 => 1 error "0**0 not defined for cardinal numbers." diff --git a/src/algebra/dhmatrix.spad.pamphlet b/src/algebra/dhmatrix.spad.pamphlet index 5c075992..c6a968a3 100644 --- a/src/algebra/dhmatrix.spad.pamphlet +++ b/src/algebra/dhmatrix.spad.pamphlet @@ -1675,7 +1675,7 @@ DenavitHartenbergMatrix(R): Exports == Implementation where -- [ax,ay,az,-(px*ax+py*ay+pz*az)],_ -- [ 0, 0, 0, 1]]) - d * p == + d:% * p: Point(R) == v := p pretend Vector R v := concat(v, 1$R) v := d * v diff --git a/src/algebra/divisor.spad.pamphlet b/src/algebra/divisor.spad.pamphlet index 05a201cc..adc98c0f 100644 --- a/src/algebra/divisor.spad.pamphlet +++ b/src/algebra/divisor.spad.pamphlet @@ -788,8 +788,11 @@ HyperellipticFiniteDivisor(F, UP, UPUP, R): Exports == Implementation where reduce makeDivisor(a, bb, 1) @ + \section{domain FDIV FiniteDivisor} + <<domain FDIV FiniteDivisor>>= +import Vector )abbrev domain FDIV FiniteDivisor ++ Finite rational divisors on a curve ++ Author: Manuel Bronstein @@ -825,7 +828,7 @@ FiniteDivisor(F, UP, UPUP, R): Exports == Implementation where 0 == 0$Rep coerce(d:$):OutputForm == coerce(d)$Rep d1 = d2 == d1 =$Rep d2 - n * d == n *$Rep d + n:Integer * d:% == n *$Rep d d1 + d2 == d1 +$Rep d2 - d == -$Rep d ideal d == ideal(d)$Rep @@ -856,7 +859,7 @@ FiniteDivisor(F, UP, UPUP, R): Exports == Implementation where ideal d == d.id decompose d == [ideal d, 1] d1 = d2 == basis(ideal d1) = basis(ideal d2) - n * d == divisor(ideal(d) ** n) + n: Integer * d:% == divisor(ideal(d) ** n) d1 + d2 == divisor(ideal d1 * ideal d2) - d == divisor inv ideal d divisor(h, d, dp, g, r) == makeDivisor(d, lift h - (r * dp)::RF::UPUP, g) diff --git a/src/algebra/expexpan.spad.pamphlet b/src/algebra/expexpan.spad.pamphlet index 30e4877b..5dbc4c57 100644 --- a/src/algebra/expexpan.spad.pamphlet +++ b/src/algebra/expexpan.spad.pamphlet @@ -160,7 +160,7 @@ UnivariatePuiseuxSeriesWithExponentialSingularity(R,FE,var,cen):_ dominantTermOnList : (L Term,RN,I) -> Union(Term,"failed") iDominantTerm : L Term -> Union(Record(%term:Term,%type:String),"failed") - retractIfCan f == + retractIfCan(f: %): Union(UPXS,"failed") == (numberOfMonomials f = 1) and (zero? degree f) => leadingCoefficient f "failed" diff --git a/src/algebra/ffcat.spad.pamphlet b/src/algebra/ffcat.spad.pamphlet index c87c4c12..b69923d4 100644 --- a/src/algebra/ffcat.spad.pamphlet +++ b/src/algebra/ffcat.spad.pamphlet @@ -117,8 +117,18 @@ ExtensionField(F:Field) : Category == Join(Field,RetractableTo F,VectorSpace F) Frobenius(a,s) == a ** (size()$F ** s) @ + \section{category FAXF FiniteAlgebraicExtensionField} + <<category FAXF FiniteAlgebraicExtensionField>>= +import Boolean +import NonNegativeInteger +import PositiveInteger +import Vector +import Matrix +import SparseUnivariatePolynomial +import OnePointCompletion +import CardinalNumber )abbrev category FAXF FiniteAlgebraicExtensionField ++ Author: J. Grabmeier, A. Scheerhorn ++ Date Created: 11 March 1991 @@ -283,7 +293,7 @@ FiniteAlgebraicExtensionField(F : Field) : Category == _ m algebraic? a == true transcendent? a == false - extensionDegree() == (#basis()) :: PositiveInteger + extensionDegree(): PositiveInteger == (#basis()) :: PositiveInteger -- degree a == degree(minimalPolynomial a)$SUP(F) :: PI trace a == b := basis() @@ -384,7 +394,7 @@ FiniteAlgebraicExtensionField(F : Field) : Category == _ for i in 0..extensionDegree()-1] gcd(p,f) = 1 => true false - degree a == + degree(a: %): PositiveInteger == y:$:=Frobenius a deg:PI:=1 while y~=a repeat @@ -475,8 +485,19 @@ DiscreteLogarithmPackage(M): public == private where disclog pretend NonNegativeInteger @ + \section{category FFIELDC FiniteFieldCategory} + <<category FFIELDC FiniteFieldCategory>>= +import Boolean +import Integer +import NonNegativeInteger +import PositiveInteger +import Matrix +import List +import Table +import OnePointCompletion +import SparseUnivariatePolynomial )abbrev category FFIELDC FiniteFieldCategory ++ Author: J. Grabmeier, A. Scheerhorn ++ Date Created: 11 March 1991 @@ -600,7 +621,7 @@ FiniteFieldCategory() : Category ==_ -- equalone := one?(a**(q quo exp.factor)) equalone := ((a**(q quo exp.factor)) = 1) not equalone - order e == + order(e: %): PositiveInteger == e = 0 => error "order(0) is not defined " ord:Integer:= size()-1 -- order e divides ord a:Integer:= 0 diff --git a/src/algebra/ffcg.spad.pamphlet b/src/algebra/ffcg.spad.pamphlet index 212bc91b..941c34d6 100644 --- a/src/algebra/ffcg.spad.pamphlet +++ b/src/algebra/ffcg.spad.pamphlet @@ -25,8 +25,12 @@ -- finite field represented by it's cyclic group and 'zero' as an -- extra element \end{verbatim} + \section{domain FFCGP FiniteFieldCyclicGroupExtensionByPolynomial} + <<domain FFCGP FiniteFieldCyclicGroupExtensionByPolynomial>>= +import SingleInteger +import PrimitiveArray )abbrev domain FFCGP FiniteFieldCyclicGroupExtensionByPolynomial ++ Authors: J.Grabmeier, A.Scheerhorn ++ Date Created: 26.03.1991 @@ -282,7 +286,7 @@ FiniteFieldCyclicGroupExtensionByPolynomial(GF,defpol):_ initelt?:=false void()$Void - extensionDegree() == extdeg pretend PI + extensionDegree(): PositiveInteger == extdeg pretend PI characteristic() == characteristic()$GF diff --git a/src/algebra/ffnb.spad.pamphlet b/src/algebra/ffnb.spad.pamphlet index b342f19e..c283b9ff 100644 --- a/src/algebra/ffnb.spad.pamphlet +++ b/src/algebra/ffnb.spad.pamphlet @@ -379,8 +379,12 @@ InnerNormalBasisFieldFunctions(GF): Exports == Implementation where +/[monomial(x.i,(i-1)::NNI)$(SUP GF) for i in 1..(#x)::I] @ + \section{domain FFNBP FiniteFieldNormalBasisExtensionByPolynomial} + <<domain FFNBP FiniteFieldNormalBasisExtensionByPolynomial>>= +import NonNegativeInteger +import Matrix )abbrev domain FFNBP FiniteFieldNormalBasisExtensionByPolynomial ++ Authors: J.Grabmeier, A.Scheerhorn ++ Date Created: 26.03.1991 @@ -514,7 +518,7 @@ FiniteFieldNormalBasisExtensionByPolynomial(GF,uni): Exports == _ coerce(v:GF):$ == new(extdeg,v /$GF traceAlpha)$Rep represents(v) == v::$ - degree(a) == + degree(a: %): PositiveInteger == d:PI:=1 b:= qPot(a::Rep,1)$INBFF while (b~=a) repeat @@ -652,7 +656,7 @@ divisor of the order of the multiplicative group" if empty? facOfGroupSize then initializeElt() facOfGroupSize - extensionDegree() == extdeg + extensionDegree(): PositiveInteger == extdeg sizeOfGroundField() == size()$GF pretend NNI diff --git a/src/algebra/ffp.spad.pamphlet b/src/algebra/ffp.spad.pamphlet index 9b38f959..67b32b90 100644 --- a/src/algebra/ffp.spad.pamphlet +++ b/src/algebra/ffp.spad.pamphlet @@ -28,7 +28,9 @@ -- 04.04.91 JG: comment of FFP was changed \end{verbatim} + \section{domain FFP FiniteFieldExtensionByPolynomial} + <<domain FFP FiniteFieldExtensionByPolynomial>>= )abbrev domain FFP FiniteFieldExtensionByPolynomial ++ Authors: R.Sutor, J. Grabmeier, O. Gschnitzer, A. Scheerhorn @@ -130,7 +132,7 @@ FiniteFieldExtensionByPolynomial(GF:FiniteFieldCategory,_ a:$:=norm(primitiveElement(),n) vector [a**i for i in 0..n-1] - degree(x) == + degree(x: %): PositiveInteger == y:$:=1 m:=zero(extdeg,extdeg+1)$(Matrix GF) for i in 1..extdeg+1 repeat @@ -249,7 +251,7 @@ FiniteFieldExtensionByPolynomial(GF:FiniteFieldCategory,_ coerce(e:$):OutputForm == outputForm(lift(e),alpha) - extensionDegree() == extdeg + extensionDegree(): PositiveInteger == extdeg size() == (sizeCG + 1) pretend NNI diff --git a/src/algebra/generic.spad.pamphlet b/src/algebra/generic.spad.pamphlet index 611284be..01c7e3fc 100644 --- a/src/algebra/generic.spad.pamphlet +++ b/src/algebra/generic.spad.pamphlet @@ -9,8 +9,13 @@ \eject \tableofcontents \eject + \section{domain GCNAALG GenericNonAssociativeAlgebra} + <<domain GCNAALG GenericNonAssociativeAlgebra>>= +import Fraction +import Polynomial +import SparseUnivariatePolynomial )abbrev domain GCNAALG GenericNonAssociativeAlgebra ++ Authors: J. Grabmeier, R. Wisbauer ++ Date Created: 26 June 1991 @@ -209,11 +214,11 @@ GenericNonAssociativeAlgebra(R : CommutativeRing, n : PositiveInteger,_ rightRankPoly := rightMinimalPolynomial genericElement void()$Void - leftRankPolynomial() == + leftRankPolynomial(): SparseUnivariatePolynomial FPR == if initLeft? then initializeLeft() leftRankPoly - rightRankPolynomial() == + rightRankPolynomial(): SparseUnivariatePolynomial FPR == if initRight? then initializeRight() rightRankPoly diff --git a/src/algebra/groebf.spad.pamphlet b/src/algebra/groebf.spad.pamphlet index 47225404..fe1a43e4 100644 --- a/src/algebra/groebf.spad.pamphlet +++ b/src/algebra/groebf.spad.pamphlet @@ -9,8 +9,12 @@ \eject \tableofcontents \eject + \section{package GBF GroebnerFactorizationPackage} + <<package GBF GroebnerFactorizationPackage>>= +import Boolean +import List )abbrev package GBF GroebnerFactorizationPackage ++ Author: H. Michael Moeller, Johannes Grabmeier ++ Date Created: 24 August 1989 @@ -323,7 +327,7 @@ GroebnerFactorizationPackage(Dom, Expon, VarSet, Dpol): T == C where we found reducible polynomials and continue splitting")$OUT createGroebnerBases([],[],[],basis,[],[],info) - groebnerFactorize(basis, nonZeroRestrictions) == + groebnerFactorize(basis: List Dpol, nonZeroRestrictions: List Dpol) == groebnerFactorize(basis, nonZeroRestrictions, false) groebnerFactorize(basis, nonZeroRestrictions, info) == @@ -337,7 +341,8 @@ GroebnerFactorizationPackage(Dom, Expon, VarSet, Dpol): T == C where createGroebnerBases([],[],nonZeroRestrictions,basis,[],[],info) groebnerFactorize(basis) == groebnerFactorize(basis, [], false) - groebnerFactorize(basis,info) == groebnerFactorize(basis, [], info) + groebnerFactorize(basis: List Dpol,info: Boolean) == + groebnerFactorize(basis, [], info) @ \section{License} diff --git a/src/algebra/modring.spad.pamphlet b/src/algebra/modring.spad.pamphlet index bfd9912a..3ee11ff6 100644 --- a/src/algebra/modring.spad.pamphlet +++ b/src/algebra/modring.spad.pamphlet @@ -56,7 +56,7 @@ ModularRing(R,Mod,reduction:(R,Mod) -> R, --define modulus(x) == x.modulo - coerce(x) == x.val + coerce(x: %): R == x.val coerce(i:Integer):% == [i::R,0]$Rep i:Integer * x:% == (i::%)*x coerce(x):OutputForm == (x.val)::OutputForm diff --git a/src/algebra/moebius.spad.pamphlet b/src/algebra/moebius.spad.pamphlet index a6b10b66..d0681a82 100644 --- a/src/algebra/moebius.spad.pamphlet +++ b/src/algebra/moebius.spad.pamphlet @@ -1,16 +1,20 @@ \documentclass{article} \usepackage{axiom} \begin{document} -\title{\$SPAD/src/algebra moebius.spad} + +\title{src/algebra moebius.spad} \author{Stephen M. Watt} \maketitle + \begin{abstract} \end{abstract} -\eject + \tableofcontents \eject + \section{domain MOEBIUS MoebiusTransform} <<domain MOEBIUS MoebiusTransform>>= +import OnePointCompletion )abbrev domain MOEBIUS MoebiusTransform ++ 2-by-2 matrices acting on P1(F). ++ Author: Stephen "Say" Watt @@ -79,7 +83,7 @@ MoebiusTransform(F): Exports == Implementation where shift(t,f) == moebius(a(t) + f*c(t), b(t) + f*d(t), c(t), d(t)) scale(t,f) == moebius(f*a(t),f*b(t),c(t),d(t)) - recip t == moebius(c(t),d(t),a(t),b(t)) + recip(t: %): % == moebius(c(t),d(t),a(t),b(t)) eval(t:%,f:F) == (a(t)*f + b(t))/(c(t)*f + d(t)) eval(t:%,f:P1F) == diff --git a/src/algebra/mts.spad.pamphlet b/src/algebra/mts.spad.pamphlet index 1d26d0a1..35399ac6 100644 --- a/src/algebra/mts.spad.pamphlet +++ b/src/algebra/mts.spad.pamphlet @@ -9,8 +9,13 @@ \eject \tableofcontents \eject + \section{domain SMTS SparseMultivariateTaylorSeries} + <<domain SMTS SparseMultivariateTaylorSeries>>= +import NonNegativeInteger +import List +import Stream )abbrev domain SMTS SparseMultivariateTaylorSeries ++ This domain provides multivariate Taylor series ++ Authors: William Burge, Stephen Watt, Clifton Williamson @@ -84,7 +89,8 @@ SparseMultivariateTaylorSeries(Coef,Var,SMP):_ ints := integers(0)$STT pretend ST NNI map(monomial(#2 :: SMP,v,#1)$SMP,ints,s pretend ST Coef)$ST3(NNI,Coef,SMP) - coefficient(s,n) == elt(s,n + 1)$Rep -- 1-based indexing for streams + coefficient(s:%,n: NNI) == + elt(s,n + 1)$Rep -- 1-based indexing for streams --% creation of series diff --git a/src/algebra/naalgc.spad.pamphlet b/src/algebra/naalgc.spad.pamphlet index 2eee8450..37f1babe 100644 --- a/src/algebra/naalgc.spad.pamphlet +++ b/src/algebra/naalgc.spad.pamphlet @@ -119,12 +119,12 @@ MonadWithUnit(): Category == Monad with x:% ** n:NonNegativeInteger == zero? n => 1 expt(x,n pretend PositiveInteger) - rightPower(a,n) == + rightPower(a: %,n: NonNegativeInteger) == zero? n => 1 res := 1 for i in 1..n repeat res := res * a res - leftPower(a,n) == + leftPower(a: %,n: NonNegativeInteger) == zero? n => 1 res := 1 for i in 1..n repeat res := a * res diff --git a/src/algebra/ore.spad.pamphlet b/src/algebra/ore.spad.pamphlet index 9617f107..3e2f769c 100644 --- a/src/algebra/ore.spad.pamphlet +++ b/src/algebra/ore.spad.pamphlet @@ -275,6 +275,8 @@ ApplyUnivariateSkewPolynomial(R:Ring, M: LeftModule R, @ \section{domain AUTOMOR Automorphism} <<domain AUTOMOR Automorphism>>= +import Integer +import NonNegativeInteger )abbrev domain AUTOMOR Automorphism ++ Author: Manuel Bronstein ++ Date Created: 31 January 1994 @@ -308,7 +310,7 @@ Automorphism(R:Ring): Join(Group, Eltable(R, R)) with f = g == EQ(f, g)$Lisp elt(f, r) == apply(f, r, 1) inv f == apply(f, #1, - #2) - f ** n == apply(f, #1, n * #2) + (f: %) ** (n: Integer) == apply(f, #1, n * #2) coerce(f:%):OutputForm == message("R -> R") morphism(f:(R, Integer) -> R):% == f morphism(f:R -> R):% == morphism(f, err) diff --git a/src/algebra/outform.spad.pamphlet b/src/algebra/outform.spad.pamphlet index 3f5c2aaf..00ca7d81 100644 --- a/src/algebra/outform.spad.pamphlet +++ b/src/algebra/outform.spad.pamphlet @@ -202,8 +202,18 @@ NumberFormats(): NFexports == NFimplementation where tot::PI @ + \section{domain OUTFORM OutputForm} + <<domain OUTFORM OutputForm>>= +import Void +import Boolean +import Integer +import NonNegativeInteger +import DoubleFloat +import Symbol +import String +import List )abbrev domain OUTFORM OutputForm ++ Keywords: output, I/O, expression ++ SMW March/88 @@ -571,7 +581,7 @@ OutputForm(): SetCategory with vconcat(a,b) == [eform VCONCAT, a, b] vconcat l == cons(eform VCONCAT, l) - a ~= b == [sform "~=", a, b] + (a:% ~= b:%): % == [sform "~=", a, b] a < b == [sform "<", a, b] a > b == [sform ">", a, b] a <= b == [sform "<=", a, b] diff --git a/src/algebra/pf.spad.pamphlet b/src/algebra/pf.spad.pamphlet index 338b56c2..4eaf3fbf 100644 --- a/src/algebra/pf.spad.pamphlet +++ b/src/algebra/pf.spad.pamphlet @@ -169,7 +169,7 @@ InnerPrimeField(p:PositiveInteger): Exports == Implementation where inGroundField?(x) == true - coordinates(x) == new(1,x)$(Vector $) + coordinates(x: %) == new(1,x)$(Vector $) represents(v) == v.1 @@ -189,7 +189,7 @@ InnerPrimeField(p:PositiveInteger): Exports == Implementation where minimalPolynomial(x) == monomial(1,1)$(SUP $) - monomial(x,0)$(SUP $) - charthRoot x == x + charthRoot(x: %): % == x @ \section{domain PF PrimeField} diff --git a/src/algebra/poly.spad.pamphlet b/src/algebra/poly.spad.pamphlet index ec3a2f79..9cdc6ad8 100644 --- a/src/algebra/poly.spad.pamphlet +++ b/src/algebra/poly.spad.pamphlet @@ -383,8 +383,12 @@ PolynomialRing(R:Ring,E:OrderedAbelianMonoid): T == C x/r == inv(r)*x @ + \section{domain SUP SparseUnivariatePolynomial} + <<domain SUP SparseUnivariatePolynomial>>= +import NonNegativeInteger +import OutputForm )abbrev domain SUP SparseUnivariatePolynomial ++ Author: Dave Barton, Barry Trager ++ Date Created: @@ -555,7 +559,7 @@ SparseUnivariatePolynomial(R:Ring): UnivariatePolynomialCategory(R) with if R has IntegralDomain then if R has approximate then - p1 exquo p2 == + p1:% exquo p2:% == null p2 => error "Division by 0" p2 = 1 => p1 p1=p2 => 1 @@ -571,7 +575,7 @@ SparseUnivariatePolynomial(R:Ring): UnivariatePolynomialCategory(R) with null p1 => reverse(rout)::% -- nreverse? "failed" else -- R not approximate - p1 exquo p2 == + p1:% exquo p2:% == null p2 => error "Division by 0" p2 = 1 => p1 --(p1.lastElt.c exquo p2.lastElt.c) case "failed" => "failed" diff --git a/src/algebra/polycat.spad.pamphlet b/src/algebra/polycat.spad.pamphlet index 4cdd3572..9f86558a 100644 --- a/src/algebra/polycat.spad.pamphlet +++ b/src/algebra/polycat.spad.pamphlet @@ -78,6 +78,9 @@ AbelianMonoidRing(R:Ring, E:OrderedAbelianMonoid): Category == @ \section{category FAMR FiniteAbelianMonoidRing} <<category FAMR FiniteAbelianMonoidRing>>= +import Boolean +import NonNegativeInteger +import List )abbrev category FAMR FiniteAbelianMonoidRing ++ Author: ++ Date Created: @@ -162,7 +165,7 @@ FiniteAbelianMonoidRing(R:Ring, E:OrderedAbelianMonoid): Category == if R has Field then x/r == map(#1/r,x) if R has IntegralDomain then - x exquo r == + (x: %) exquo (r: R) == -- probably not a very good definition in most special cases zero? x => 0 ans:% :=0 diff --git a/src/algebra/prtition.spad.pamphlet b/src/algebra/prtition.spad.pamphlet index 0148ff2d..45466b9c 100644 --- a/src/algebra/prtition.spad.pamphlet +++ b/src/algebra/prtition.spad.pamphlet @@ -1,16 +1,21 @@ \documentclass{article} \usepackage{axiom} \begin{document} -\title{\$SPAD/src/algebra prtition.spad} + +\title{src/algebra prtition.spad} \author{William H. Burge} \maketitle + \begin{abstract} \end{abstract} -\eject \tableofcontents \eject + \section{domain PRTITION Partition} + <<domain PRTITION Partition>>= +import Integer +import List )abbrev domain PRTITION Partition ++ Domain for partitions of positive integers ++ Author: William H. Burge @@ -56,7 +61,7 @@ Partition: Exports == Implementation where Rep := List Integer 0 == nil() - coerce (s:%) == s pretend List Integer + coerce (s:%): List Integer == s pretend List Integer convert x == copy(x pretend L I) partition list == sort(#2 < #1,list) diff --git a/src/algebra/radix.spad.pamphlet b/src/algebra/radix.spad.pamphlet index 02fd8169..7cee785e 100644 --- a/src/algebra/radix.spad.pamphlet +++ b/src/algebra/radix.spad.pamphlet @@ -9,8 +9,14 @@ \eject \tableofcontents \eject + \section{domain RADIX RadixExpansion} + <<domain RADIX RadixExpansion>>= +import Integer +import Fraction +import List +import Stream )abbrev domain RADIX RadixExpansion ++ Author: Stephen M. Watt ++ Date Created: October 1986 @@ -128,7 +134,7 @@ RadixExpansion(bb): Exports == Implementation where n0 := 0 for r in a.int repeat n0 := bb*n0 + r a.sgn*n0 - fractionPart a == + fractionPart(a: %): Fraction Integer == n0 := 0 for r in a.pfx repeat n0 := bb*n0 + r null a.cyc => diff --git a/src/algebra/rep2.spad.pamphlet b/src/algebra/rep2.spad.pamphlet index 45fddeb4..b1bc74ad 100644 --- a/src/algebra/rep2.spad.pamphlet +++ b/src/algebra/rep2.spad.pamphlet @@ -9,8 +9,17 @@ \eject \tableofcontents \eject + \section{package REP2 RepresentationPackage2} + <<package REP2 RepresentationPackage2>>= +import Boolean +import Integer +import PositiveInteger +import List +import Vector +import Matrix + )abbrev package REP2 RepresentationPackage2 ++ Authors: Holger Gollan, Johannes Grabmeier ++ Date Created: 10 September 1987 @@ -745,7 +754,7 @@ RepresentationPackage2(R): public == private where meatAxe(algebraGenerators, false, 25, 7) - meatAxe (algebraGenerators, randomElements?) == + meatAxe (algebraGenerators: L M R, randomElements?: Boolean) == randomElements? => meatAxe (algebraGenerators, true, 25, 7) meatAxe(algebraGenerators, false, 6, 7) diff --git a/src/algebra/sf.spad.pamphlet b/src/algebra/sf.spad.pamphlet index ddbedb5b..5a28b642 100644 --- a/src/algebra/sf.spad.pamphlet +++ b/src/algebra/sf.spad.pamphlet @@ -399,8 +399,6 @@ DoubleFloat(): Join(FloatingPointSystem, DifferentialRing, OpenMath, ++ x ** y returns the yth power of x (equal to \spad{exp(y log x)}). exp1 : () -> % ++ exp1() returns the natural log base \spad{2.718281828...}. - hash : % -> Integer - ++ hash(x) returns the hash key for x log2 : % -> % ++ log2(x) computes the logarithm with base 2 for x. log10: % -> % diff --git a/src/algebra/si.spad.pamphlet b/src/algebra/si.spad.pamphlet index 48bf6ac4..0a9f7095 100644 --- a/src/algebra/si.spad.pamphlet +++ b/src/algebra/si.spad.pamphlet @@ -59,8 +59,6 @@ IntegerNumberSystem(): Category == ++ random() creates a random element. random : % -> % ++ random(a) creates a random element from 0 to \spad{n-1}. - hash : % -> % - ++ hash(n) returns the hash code of n. copy : % -> % ++ copy(n) gives a copy of n. inc : % -> % diff --git a/src/algebra/stream.spad.pamphlet b/src/algebra/stream.spad.pamphlet index 0879aad5..0241548c 100644 --- a/src/algebra/stream.spad.pamphlet +++ b/src/algebra/stream.spad.pamphlet @@ -551,11 +551,13 @@ CyclicStreamTools(S,ST): Exports == Implementation where \section{domain STREAM Stream} <<domain STREAM Stream>>= import Type +import Void import Boolean import Integer import NonNegativeInteger import UniversalSegment import List +import OutputForm )abbrev domain STREAM Stream ++ Implementation of streams via lazy evaluation ++ Authors: Burge, Watt; updated by Clifton J. Williamson @@ -823,7 +825,7 @@ Stream(S): Exports == Implementation where p(frst x) => remove(p,rst x) concat(frst x,remove(p,rst x)) - remove(p,x) == + remove(p: S -> Boolean,x:%) == explicitlyEmpty? x => empty() eq?(x,rst x) => p(frst x) => empty() diff --git a/src/algebra/string.spad.pamphlet b/src/algebra/string.spad.pamphlet index 0b155aae..7a370732 100644 --- a/src/algebra/string.spad.pamphlet +++ b/src/algebra/string.spad.pamphlet @@ -117,6 +117,9 @@ Character: OrderedFinite() with \section{domain CCLASS CharacterClass} <<domain CCLASS CharacterClass>>= +import Character +import String +import List )abbrev domain CCLASS CharacterClass ++ Author: Stephen M. Watt ++ Date Created: July 1986 @@ -204,7 +207,7 @@ CharacterClass: Join(SetCategory, ConvertibleTo String, brace():% == charClass [] insert_!(c, a) == (a(ord c) := true; a) - remove_!(c, a) == (a(ord c) := false; a) + remove_!(c: Character, a:%) == (a(ord c) := false; a) inspect(a) == for i in 0..N-1 | a.i repeat diff --git a/src/algebra/tree.spad.pamphlet b/src/algebra/tree.spad.pamphlet index a174308e..c574d9a4 100644 --- a/src/algebra/tree.spad.pamphlet +++ b/src/algebra/tree.spad.pamphlet @@ -9,8 +9,12 @@ \eject \tableofcontents \eject + \section{domain TREE Tree} + <<domain TREE Tree>>= +import Boolean +import List )abbrev domain TREE Tree ++ Author:W. H. Burge ++ Date Created:17 Feb 1992 @@ -66,7 +70,7 @@ Tree(S: SetCategory): T==C where setvalue_!(t,s) == t case empty => error "cannot set value of an empty tree" (t.node.value:=s;s) - count(n, t) == + count(n: S, t: %) == t case empty => 0 i := +/[count(n, c) for c in children t] value t = n => i + 1 diff --git a/src/algebra/triset.spad.pamphlet b/src/algebra/triset.spad.pamphlet index 2fa126c0..1057bf7b 100644 --- a/src/algebra/triset.spad.pamphlet +++ b/src/algebra/triset.spad.pamphlet @@ -9,8 +9,14 @@ \eject \tableofcontents \eject + \section{category TSETCAT TriangularSetCategory} + <<category TSETCAT TriangularSetCategory>>= +import Boolean +import NonNegativeInteger +import OutputForm +import List )abbrev category TSETCAT TriangularSetCategory ++ Author: Marc Moreno Maza (marc@nag.co.uk) ++ Date Created: 04/26/1994 @@ -317,7 +323,7 @@ TriangularSetCategory(R:IntegralDomain,E:OrderedAbelianMonoidSup,_ p := init(p) red - reduce(p,ts,redOp,redOp?) == + reduce(p: P,ts: S,redOp: (P,P)->P,redOp?: (P,P)->Boolean) == (empty? ts) or (ground? p) => p ts0 := ts while (not empty? ts) and (not ground? p) repeat @@ -428,7 +434,7 @@ TriangularSetCategory(R:IntegralDomain,E:OrderedAbelianMonoidSup,_ algebraic? (v,ts) == member?(v,algebraicVariables(ts)) - select (ts,v) == + select(ts: %,v: V): Union(P,"failed") == lp : List (P) := sort(supRittWu?,members(ts))$(List P) while (not empty? lp) and (not (v = mvar(first lp))) repeat lp := rest lp diff --git a/src/algebra/view2D.spad.pamphlet b/src/algebra/view2D.spad.pamphlet index 8d2b67e4..fc770f12 100644 --- a/src/algebra/view2D.spad.pamphlet +++ b/src/algebra/view2D.spad.pamphlet @@ -6,10 +6,11 @@ \maketitle \begin{abstract} \end{abstract} -\eject \tableofcontents \eject + \section{domain GRIMAGE GraphImage} + <<domain GRIMAGE GraphImage>>= )abbrev domain GRIMAGE GraphImage ++ Author: Jim Wen @@ -365,7 +366,7 @@ GraphImage (): Exports == Implementation where unitsToBe graphImage == graph [] - makeGraphImage(llp) == + makeGraphImage(llp: L L P) == l := #llp makeGraphImage(llp, [pointColorDefault() for i in 1..l], diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot index c45159a7..3735a815 100644 --- a/src/interp/c-util.boot +++ b/src/interp/c-util.boot @@ -794,3 +794,17 @@ displayModemaps E == GCOPY ob == COPY ob -- for now +--% +++ format the set of candidate operations. +displayAmbiguousSignatures(op,sigs) == + [:showCandidate(op, sig) for sig in sigs] where + showCandidate(op,sig) == + ["%l", " ", op, '": ", + :bright formatUnabbreviated ["Mapping",:sig]] + +++ Display diagnostic message about ambiguous operation `op', with +++ possible resolutions given by the list `sigs'. +ambiguousSignatureError(op, sigs) == + stackSemanticError(['"signature of lhs not unique. Candidates are:", + :displayAmbiguousSignatures($op,sigs)],nil) + diff --git a/src/interp/define.boot b/src/interp/define.boot index 2e096be4..2d1a94e4 100644 --- a/src/interp/define.boot +++ b/src/interp/define.boot @@ -996,10 +996,8 @@ hasSigInTargetCategory(argl,form,opsig,e) == --accept only those signatures op right length which match declared modes 0=c => (#(sig:= getSignatureFromMode(form,e))=#form => sig; nil) 1<c => - sig:= first potentialSigList - stackWarning('"signature of lhs not unique: %1bp chosen", - [["Mapping",:sig]]) - sig + ambiguousSignatureError($op,potentialSigList) + first potentialSigList nil --this branch will force all arguments to be declared compareMode2Arg(x,m) == null x or modeEqual(x,m) diff --git a/src/interp/lisplib.boot b/src/interp/lisplib.boot index 7296b447..641b2799 100644 --- a/src/interp/lisplib.boot +++ b/src/interp/lisplib.boot @@ -425,7 +425,7 @@ initializeLisplib libName == ++ return to toplevel reader. leaveIfErrors libName == errorCount() ^=0 => - sayMSG ['" Errors in processing ",$liplibkind,'" ",:bright libName,'":"] + sayMSG ['" Errors in processing ",$lisplibKind,'" ",:bright libName,'":"] sayMSG ['" not replacing ",$spadLibFT,'" for",:bright libName] spadThrow() |