diff options
author | dos-reis <gdr@axiomatics.org> | 2007-08-14 05:14:52 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2007-08-14 05:14:52 +0000 |
commit | ab8cc85adde879fb963c94d15675783f2cf4b183 (patch) | |
tree | c202482327f474583b750b2c45dedfc4e4312b1d /src/input/patmatch.input.pamphlet | |
download | open-axiom-ab8cc85adde879fb963c94d15675783f2cf4b183.tar.gz |
Initial population.
Diffstat (limited to 'src/input/patmatch.input.pamphlet')
-rw-r--r-- | src/input/patmatch.input.pamphlet | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/input/patmatch.input.pamphlet b/src/input/patmatch.input.pamphlet new file mode 100644 index 00000000..b80a0a18 --- /dev/null +++ b/src/input/patmatch.input.pamphlet @@ -0,0 +1,56 @@ +\documentclass{article} +\usepackage{axiom} +\begin{document} +\title{\$SPAD/src/input patmatch.input} +\author{The Axiom Team} +\maketitle +\begin{abstract} +\end{abstract} +\eject +\tableofcontents +\eject +\section{License} +<<license>>= +--Copyright The Numerical Algorithms Group Limited 1991. +@ +<<*>>= +<<license>> + +)cl all +p := 3 * n ** 2 + 1 +q := 3 * n% ** 2 + 1 +a := roman 49 +b := roman IV +c := a - 1 +Is(a, p) +Is(a, q) +Is(b, p) +Is(b, q) +Is(c, p) +Is(c, q) +ab := a / b +pq := p / q +Is(ab, pq) +ab := rational ab +a := rational a +--Is([ab, a], [pq, _:l, p]) +--Is([ab, a], [pq, _:l%, p]) +--Is([ab, 1, 2, a], [pq, _:l, p]) +-- foo?(x:LIST FRAC INT):BOOLEAN == odd? _# x +-- qq := suchThat(_:l%, foo?) +-- Is([ab, 1, 2, a], [pq, qq, p]) +-- Is([ab, 1, 2, 3, a], [pq, qq, p]) +-- creating streams using pattern matching +-- want the streams of all primes of the form m**2+1 +bar?(n:INT):BOOLEAN == prime? n and is?(n, m**2 + 1) +myprimes := [i for i in 1.. | bar? i] +p := x**2 + 3*x + 1 +Is(p, n * y**2 + (2*n+1)*y + 1) +Is(p, n% * y**2 + (2*n%+1)*y + 1) +Is(3*x**2 + 9*x + 1, n * y**2 + n**2 * y + 1) +@ +\eject +\begin{thebibliography}{99} +\bibitem{1} nothing +\end{thebibliography} +\end{document} |