diff options
Diffstat (limited to 'src/algebra')
-rw-r--r-- | src/algebra/alql.spad.pamphlet | 4 | ||||
-rw-r--r-- | src/algebra/fortmac.spad.pamphlet | 6 | ||||
-rw-r--r-- | src/algebra/fortran.spad.pamphlet | 16 | ||||
-rw-r--r-- | src/algebra/integer.spad.pamphlet | 8 | ||||
-rw-r--r-- | src/algebra/ituple.spad.pamphlet | 12 | ||||
-rw-r--r-- | src/algebra/matrix.spad.pamphlet | 22 | ||||
-rw-r--r-- | src/algebra/pf.spad.pamphlet | 2 | ||||
-rw-r--r-- | src/algebra/radix.spad.pamphlet | 6 |
8 files changed, 36 insertions, 40 deletions
diff --git a/src/algebra/alql.spad.pamphlet b/src/algebra/alql.spad.pamphlet index a7f895a1..edcae0c5 100644 --- a/src/algebra/alql.spad.pamphlet +++ b/src/algebra/alql.spad.pamphlet @@ -29,8 +29,8 @@ DataList(S:OrderedSet) : Exports == Implementation where elt(x,"unique") == removeDuplicates(x) elt(x,"sort") == sort(x) elt(x,"count") == #x - coerce(x:List S) == x pretend % - coerce(x:%):List S == x pretend (List S) + coerce(x:List S) == per x + coerce(x:%):List S == rep x coerce(x:%): OutputForm == (x :: List S) :: OutputForm datalist(x:List S) == x::% diff --git a/src/algebra/fortmac.spad.pamphlet b/src/algebra/fortmac.spad.pamphlet index 657d8da1..07016a41 100644 --- a/src/algebra/fortmac.spad.pamphlet +++ b/src/algebra/fortmac.spad.pamphlet @@ -56,11 +56,11 @@ MachineInteger(): Exports == Implementation where abs(u) > MAXINT => message: S := concat [convert(u)@S," > MAXINT(",convert(MAXINT)@S,")"] error message - u pretend $ + per u - retract(u:$):Integer == u pretend Integer + retract(u:$):Integer == rep u - retractIfCan(u:$):Union(Integer,"failed") == u pretend Integer + retractIfCan(u:$):Union(Integer,"failed") == rep u @ \section{domain MFLOAT MachineFloat} diff --git a/src/algebra/fortran.spad.pamphlet b/src/algebra/fortran.spad.pamphlet index 2507beda..4c6f9cc0 100644 --- a/src/algebra/fortran.spad.pamphlet +++ b/src/algebra/fortran.spad.pamphlet @@ -1622,7 +1622,7 @@ FortranExpression(basicSymbols,subscriptedSymbols,R): not empty? extras => m := fixUpSymbols(u) m case EXPR(R) => m::EXPR(R) - error("Extra symbols detected:",[string(v) for v in extras]$L(String)) + error ["Extra symbols detected:",[string(v) for v in extras]$L(String)] u notSymbol?(v:BO):Boolean == @@ -1648,7 +1648,7 @@ FortranExpression(basicSymbols,subscriptedSymbols,R): fortranFunctions : L S := f77Functions extras : L S := setDifference(ops,fortranFunctions) not empty? extras => - error("Non FORTRAN-77 functions detected:",[string(v) for v in extras]) + error ["Non FORTRAN-77 functions detected:",[string(v) for v in extras]] void() checkForNagOperators(u:EXPR R):$ == @@ -1658,8 +1658,8 @@ FortranExpression(basicSymbols,subscriptedSymbols,R): piOp : BasicOperator := operator X01AAF piSub : Equation EXPR R := equation(pi()$Pi::EXPR(R),kernel(piOp,0::EXPR(R))$EXPR(R)) - subst(u,piSub) pretend $ - u pretend $ + per subst(u,piSub) + per u -- Conditional retractions: @@ -1720,7 +1720,7 @@ FortranExpression(basicSymbols,subscriptedSymbols,R): pi():$ == kernel(operator X01AAF,0) - coerce(u:$):EXPR R == u pretend EXPR(R) + coerce(u:$):EXPR R == rep u retractIfCan(u:EXPR R):Union($,"failed") == if (extraSymbols? u) then @@ -1738,12 +1738,12 @@ FortranExpression(basicSymbols,subscriptedSymbols,R): retractIfCan(u:Symbol):Union($,"failed") == not (member?(u,basicSymbols) or scripted?(u) and member?(name u,subscriptedSymbols)) => "failed" - (((u::EXPR(R))$(EXPR R))pretend Rep)::$ + per (u::EXPR(R)) retract(u:Symbol):$ == res : Union($,"failed") := retractIfCan(u) - res case "failed" => error("Illegal Symbol Detected:",u::String) - res::$ + res case "failed" => error ["Illegal Symbol Detected:",u::String] + res @ \section{License} diff --git a/src/algebra/integer.spad.pamphlet b/src/algebra/integer.spad.pamphlet index ad958900..1d0009a0 100644 --- a/src/algebra/integer.spad.pamphlet +++ b/src/algebra/integer.spad.pamphlet @@ -281,9 +281,9 @@ NonNegativeInteger: Join(OrderedAbelianMonoidSup,Monoid) with sup(x,y) == MAX(x,y)$Lisp shift(x:%, n:Integer):% == ASH(x,n)$Lisp subtractIfCan(x, y) == - c:Integer := (x pretend Integer) - (y pretend Integer) + c:Integer := rep x - rep y c < 0 => "failed" - c pretend % + per c @ @@ -304,9 +304,7 @@ PositiveInteger: Join(OrderedAbelianSemiGroup,Monoid) with ++ positive integers \spad{a} and b. commutative("*") ++ commutative("*") means multiplication is commutative : x*y = y*x - == SubDomain(NonNegativeInteger,#1 > 0) add - x:% - y:% + == SubDomain(NonNegativeInteger,#1 > 0) @ diff --git a/src/algebra/ituple.spad.pamphlet b/src/algebra/ituple.spad.pamphlet index c47f99be..190ae035 100644 --- a/src/algebra/ituple.spad.pamphlet +++ b/src/algebra/ituple.spad.pamphlet @@ -45,13 +45,11 @@ InfiniteTuple(S:Type): Exports == Implementation where ++ construct(t) converts an infinite tuple to a stream. Implementation ==> Stream S add - generate(f,x) == generate(f,x)$Stream(S) pretend % - filterWhile(f, x) == filterWhile(f,x pretend Stream(S))$Stream(S) pretend % - filterUntil(f, x) == filterUntil(f,x pretend Stream(S))$Stream(S) pretend % - select(f, x) == select(f,x pretend Stream(S))$Stream(S) pretend % - construct x == x pretend Stream(S) --- coerce x == --- coerce(x)$Stream(S) + generate(f,x) == per generate(f,x)$Stream(S) + filterWhile(f, x) == per filterWhile(f,rep x)$Stream(S) + filterUntil(f, x) == per filterUntil(f,rep x)$Stream(S) + select(f, x) == per select(f,rep x)$Stream(S) + construct x == rep x @ diff --git a/src/algebra/matrix.spad.pamphlet b/src/algebra/matrix.spad.pamphlet index 660a5de4..d017dc19 100644 --- a/src/algebra/matrix.spad.pamphlet +++ b/src/algebra/matrix.spad.pamphlet @@ -293,10 +293,10 @@ RectangularMatrix(m,n,R): Exports == Implementation where mini ==> minIndex maxi ==> maxIndex - ZERO := new(m,n,0)$Matrix(R) pretend $ + ZERO := per new(m,n,0)$Matrix(R) 0 == ZERO - coerce(x:$):OutputForm == coerce(x pretend Matrix R)$Matrix(R) + coerce(x:$):OutputForm == rep(x)::OutputForm matrix(l: List List R) == -- error check: this is a top level function @@ -307,28 +307,28 @@ RectangularMatrix(m,n,R): Exports == Implementation where for i in minr(ans)..maxr(ans) for ll in l repeat for j in minc(ans)..maxc(ans) for r in ll repeat qsetelt_!(ans,i,j,r) - ans pretend $ + per ans - row(x,i) == directProduct row(x pretend Matrix(R),i) - column(x,j) == directProduct column(x pretend Matrix(R),j) + row(x,i) == directProduct row(rep x,i) + column(x,j) == directProduct column(rep x,j) - coerce(x:$):Matrix(R) == copy(x pretend Matrix(R)) + coerce(x:$):Matrix(R) == copy rep x rectangularMatrix x == (nrows(x) ~= m) or (ncols(x) ~= n) => error "rectangularMatrix: matrix of bad dimensions" - copy(x) pretend $ + per copy(x) if R has EuclideanDomain then - rowEchelon x == rowEchelon(x pretend Matrix(R)) pretend $ + rowEchelon x == per rowEchelon(rep x) if R has IntegralDomain then - rank x == rank(x pretend Matrix(R)) - nullity x == nullity(x pretend Matrix(R)) + rank x == rank rep x + nullity x == nullity rep x nullSpace x == - [directProduct c for c in nullSpace(x pretend Matrix(R))] + [directProduct c for c in nullSpace rep x] if R has Field then diff --git a/src/algebra/pf.spad.pamphlet b/src/algebra/pf.spad.pamphlet index 4eaf3fbf..21b8979a 100644 --- a/src/algebra/pf.spad.pamphlet +++ b/src/algebra/pf.spad.pamphlet @@ -84,7 +84,7 @@ InnerPrimeField(p:PositiveInteger): Exports == Implementation where zero?(n) => 1 zero?(x) => 0 r := positiveRemainder(n,p-1)::NNI - ((x pretend IntegerMod p) **$IntegerMod(p) r) pretend $ + per (rep(x) **$IntegerMod(p) r) if p <= convert(max()$SingleInteger)@Integer then q := p::SingleInteger diff --git a/src/algebra/radix.spad.pamphlet b/src/algebra/radix.spad.pamphlet index 80b12c4c..f5ed227e 100644 --- a/src/algebra/radix.spad.pamphlet +++ b/src/algebra/radix.spad.pamphlet @@ -288,7 +288,7 @@ BinaryExpansion(): Exports == Implementation where Implementation ==> RadixExpansion(2) add binary r == r :: % - coerce(x:%): RadixExpansion(2) == x pretend RadixExpansion(2) + coerce(x:%): RadixExpansion(2) == rep x @ \section{domain DECIMAL DecimalExpansion} @@ -317,7 +317,7 @@ DecimalExpansion(): Exports == Implementation where Implementation ==> RadixExpansion(10) add decimal r == r :: % - coerce(x:%): RadixExpansion(10) == x pretend RadixExpansion(10) + coerce(x:%): RadixExpansion(10) == rep x @ \section{domain HEXADEC HexadecimalExpansion} @@ -348,7 +348,7 @@ HexadecimalExpansion(): Exports == Implementation where Implementation ==> RadixExpansion(16) add hex r == r :: % - coerce(x:%): RadixExpansion(16) == x pretend RadixExpansion(16) + coerce(x:%): RadixExpansion(16) == rep x @ \section{package RADUTIL RadixUtilities} |