aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/defaults.spad.pamphlet
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@axiomatics.org>2016-01-22 08:25:59 -0800
committerGabriel Dos Reis <gdr@axiomatics.org>2016-01-22 08:25:59 -0800
commit7b6b9b1e80d0fe90a9009864f107735d244aa0d7 (patch)
treef1c17e82882d683f13a60ba64ae75f14ec4b529a /src/algebra/defaults.spad.pamphlet
parentbb57192d02a82f2236857bcbd2accca4f01f4395 (diff)
downloadopen-axiom-7b6b9b1e80d0fe90a9009864f107735d244aa0d7.tar.gz
Remove antiquated syntax for operator declaration.
Diffstat (limited to 'src/algebra/defaults.spad.pamphlet')
-rw-r--r--src/algebra/defaults.spad.pamphlet8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/algebra/defaults.spad.pamphlet b/src/algebra/defaults.spad.pamphlet
index 490ae98a..5f9ca825 100644
--- a/src/algebra/defaults.spad.pamphlet
+++ b/src/algebra/defaults.spad.pamphlet
@@ -19,14 +19,12 @@
RepeatedSquaring(S): Exports == Implementation where
S: SetCategory with
- "*":(%,%)->%
+ *: (%,%)->%
++ x*y returns the product of x and y
Exports == with
expt: (S,PositiveInteger) -> S
++ expt(r, i) computes r**i by repeated squaring
Implementation == add
- x: S
- n: PositiveInteger
expt(x, n) ==
one? n => x
odd?(n)$Integer=> x * expt(x*x,shift(n,-1) pretend PositiveInteger)
@@ -44,14 +42,12 @@ RepeatedSquaring(S): Exports == Implementation where
RepeatedDoubling(S):Exports ==Implementation where
S: SetCategory with
- "+":(%,%)->%
+ +: (%,%)->%
++ x+y returns the sum of x and y
Exports == with
double: (PositiveInteger,S) -> S
++ double(i, r) multiplies r by i using repeated doubling.
Implementation == add
- x: S
- n: PositiveInteger
double(n,x) ==
one? n => x
odd?(n)$Integer =>