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/hyper/pages/MAGMA.ht | |
download | open-axiom-ab8cc85adde879fb963c94d15675783f2cf4b183.tar.gz |
Initial population.
Diffstat (limited to 'src/hyper/pages/MAGMA.ht')
-rw-r--r-- | src/hyper/pages/MAGMA.ht | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/src/hyper/pages/MAGMA.ht b/src/hyper/pages/MAGMA.ht new file mode 100644 index 00000000..1876426e --- /dev/null +++ b/src/hyper/pages/MAGMA.ht @@ -0,0 +1,113 @@ +% Copyright The Numerical Algorithms Group Limited 1992-94. All rights reserved. +% !! DO NOT MODIFY THIS FILE BY HAND !! Created by ht.awk. +\newcommand{\MagmaXmpTitle}{Magma} +\newcommand{\MagmaXmpNumber}{9.49} +% +% ===================================================================== +\begin{page}{MagmaXmpPage}{9.49 Magma} +% ===================================================================== +\beginscroll +Initialisations +\xtc{ +}{ +\spadpaste{x:Symbol :='x \bound{x}} +} +\xtc{ +}{ +\spadpaste{y:Symbol :='y \bound{y}} +} +\xtc{ +}{ +\spadpaste{z:Symbol :='z \bound{z}} +} +\xtc{ +}{ +\spadpaste{word := OrderedFreeMonoid(Symbol) \bound{word}} +} +\xtc{ +}{ +\spadpaste{tree := Magma(Symbol) \bound{tree}} +} + +Let's make some trees +\xtc{ +}{ +\spadpaste{a:tree := x*x \free{x tree} \bound{a}} +} +\xtc{ +}{ +\spadpaste{b:tree := y*y \free{y tree} \bound{b}} +} +\xtc{ +}{ +\spadpaste{c:tree := a*b \free{a b tree} \bound{c}} +} + +Query the trees +\xtc{ +}{ +\spadpaste{left c \free{c}} +} +\xtc{ +}{ +\spadpaste{right c \free{c}} +} +\xtc{ +}{ +\spadpaste{length c \free{c}} +} +\xtc{ +Coerce to the monoid +}{ +\spadpaste{c::word \free{c word}} +} + +Check ordering +\xtc{ +}{ +\spadpaste{a < b \free{a b}} +} +\xtc{ +}{ +\spadpaste{a < c \free{a c}} +} +\xtc{ +}{ +\spadpaste{b < c \free{b c}} +} + +Navigate the tree +\xtc{ +}{ +\spadpaste{first c \free{c}} +} +\xtc{ +}{ +\spadpaste{rest c \free{c}} +} +\xtc{ +}{ +\spadpaste{rest rest c \free{c}} +} + +Check ordering +\xtc{ +}{ +\spadpaste{ax:tree := a*x \free{a x tree} \bound{ax}} +} +\xtc{ +}{ +\spadpaste{xa:tree := x*a \free{a x tree} \bound{xa}} +} +\xtc{ +}{ +\spadpaste{xa < ax \free{ax xa}} +} +\xtc{ +}{ +\spadpaste{lexico(xa,ax) \free{ax xa}} +} +\endscroll +\autobuttons +\end{page} +% |