\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}
