aboutsummaryrefslogtreecommitdiff
path: root/src/input/defs.input.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2007-08-14 05:14:52 +0000
committerdos-reis <gdr@axiomatics.org>2007-08-14 05:14:52 +0000
commitab8cc85adde879fb963c94d15675783f2cf4b183 (patch)
treec202482327f474583b750b2c45dedfc4e4312b1d /src/input/defs.input.pamphlet
downloadopen-axiom-ab8cc85adde879fb963c94d15675783f2cf4b183.tar.gz
Initial population.
Diffstat (limited to 'src/input/defs.input.pamphlet')
-rw-r--r--src/input/defs.input.pamphlet110
1 files changed, 110 insertions, 0 deletions
diff --git a/src/input/defs.input.pamphlet b/src/input/defs.input.pamphlet
new file mode 100644
index 00000000..85b35ef3
--- /dev/null
+++ b/src/input/defs.input.pamphlet
@@ -0,0 +1,110 @@
+\documentclass{article}
+\usepackage{axiom}
+\begin{document}
+\title{\$SPAD/src/input defs.input}
+\author{The Axiom Team}
+\maketitle
+\begin{abstract}
+\end{abstract}
+\eject
+\tableofcontents
+\eject
+The [[otherwise]] clause is not recognized either in the NAG version
+or the Axiom version.
+<<fib>>=
+)clear all
+
+fib(0) == 1
+fib(1) == 1
+fib(n) == fib(n-1) + fib(n-2) otherwise
+fib(10)
+fib(100)
+[fib(2**i) for i in 1..]
+
+@
+The [[when]] clause is not recognized either in the NAG version or
+the Axiom version.
+<<chebyshev>>=
+chebyshev1: Integer -> UnivariatePolynomial(x,Fraction Integer)
+chebyshev1(0) == 1
+chebyshev1(1) == x
+chebyshev1(n) == 2*x* chebyshev1(n-1) - chebyshev1(n-2) when n > 1
+chebyshev1(2)
+chebyshev1(7)
+chebyshev2 : Integer -> UnivariatePolynomial(x,Fraction Integer)
+chebyshev2 == rules
+ chebyshev2(0) == 1
+ chebyshev2(1) == 2*x
+ chebyshev2(n) == 2*x* chebyshev2(n-1) - chebyshev2(n-2) when n > 1
+chebyshev2(1)
+chebyshev2(4)
+chebyshev2(11)
+
+@
+<<*>>=
+
+-- Input for page DefinitionsVsMappings
+)clear all
+
+square(x) == x*x
+square == x +-> x*x
+factorial(0) == 1
+factorial(n) == n * fact(n - 1) when n > 0
+factorial(n) ==
+ n = 0 => 1
+ n > 0 => n * factorial(n - 1)
+factorial == n +->
+ n = 0 => 1
+ n > 0 => n * factorial(n - 1)
+
+-- Input for page DefinitionsForFunctions
+)clear all
+
+define square(x) == x*x
+square(x) == x*x
+square(111)
+square == x +-> x*x
+square(1111)
+timesY(x) == x * y
+timesY == x +-> x * y
+timesY(2)
+y := 2
+timesY(2)
+y := 3
+timesY(2)
+
+-- Input for page RulesForVariables
+)clear all
+
+rule x == y + z
+x
+rule y == z + 1
+x
+z := a; y := 1;
+x
+a := 2/3
+x
+
+-- Input for page RulesVsAssignments
+)clear all
+
+rule x == y + 1; rule y == z + 1; rule z == 7;
+[x,y,z]
+rule z == 7; rule y == z + 1; rule x == y + 1; [x, y, z]
+rule z == 1; [x, y, z]
+a := b + 1; b := c + 1; c := 7;
+[a, b, c]
+b := 5; [a, b, c]
+c := 7; b := c + 1; a := b + 1; [a, b, c]
+p := q + 1; rule q == r + 1; r := 7; [p, q, r]
+r := 1; [p, q, r]
+
+-- Input for page RecurrenceRelations
+<<fib>>
+<<chebyshev>>
+@
+\eject
+\begin{thebibliography}{99}
+\bibitem{1} nothing
+\end{thebibliography}
+\end{document}