changed: -)abbrev category MYMON rhxMonoid -rhxMonoid: Category == with )abbrev category MYMON MyMonoid MyMonoid: Category == with changed: -)abbrev domain MYFUN rhxFun -rhxFun(S: SetCategory): rhxMonoid with - myfun: (S -> S) -> % )abbrev domain MYFUN MyFun MyFun(S: SetCategory): MyMonoid with coerce: (S -> S) -> % changed: - myfun(f: S -> S): % == per f coerce(f: S -> S): % == per f added: MI ==> MyFun I changed: -minc: rhxFun(I) := myfun inc -mdouble: rhxFun(I) := myfun double minc := inc :: MI mdouble := double :: MI
Everyone is allowed to try out SPAD by editing this page. Don't be affraid to destroy anything. The purpose of this page is exactly to give a place for everyone to experiment.
Just hit the "edit" link in the upper right corner.
(1) -> <spad>
)abbrev category MYMON MyMonoid MyMonoid: Category == with 1: % _*: (%,%) -> %
rep x ==> (x@%) pretend Rep per x ==> (x@Rep) pretend %
)abbrev domain MYFUN MyFun MyFun(S: SetCategory): MyMonoid with coerce: (S -> S) -> % coerce: % -> (S -> S) == add Rep ==> S -> S coerce(f: S -> S): % == per f coerce(x: %): S -> S == rep x 1: % == per((s: S): S +-> s) ((x: %) * (y: %)): % == per( (s: S): S +-> (rep x)(rep y)s )</spad>
Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/5443222399567089399-25px001.spad using old system compiler. MYMON abbreviates category MyMonoid ------------------------------------------------------------------------ initializing NRLIB MYMON for MyMonoid compiling into NRLIB MYMON Time: 0 SEC.
finalizing NRLIB MYMON Processing MyMonoid for Browser database: --->-->MyMonoid(constructor): Not documented!!!! --->-->MyMonoid(((One) (%) constant)): Not documented!!!! --->-->MyMonoid((* (% % %))): Not documented!!!! --->-->MyMonoid(): Missing Description ; compiling file "/var/aw/var/LatexWiki/MYMON.NRLIB/MYMON.lsp" (written 14 NOV 2025 05:16:45 AM):
; wrote /var/aw/var/LatexWiki/MYMON.NRLIB/MYMON.fasl ; compilation finished in 0:00:00.012 ------------------------------------------------------------------------ MyMonoid is now explicitly exposed in frame initial MyMonoid will be automatically loaded when needed from /var/aw/var/LatexWiki/MYMON.NRLIB/MYMON
MYFUN abbreviates domain MyFun ------------------------------------------------------------------------ initializing NRLIB MYFUN for MyFun compiling into NRLIB MYFUN processing macro definition Rep ==> S -> S compiling exported coerce : S -> S -> % MYFUN;coerce;M%;1 is replaced by f Time: 0 SEC.
compiling exported coerce : % -> S -> S MYFUN;coerce;%M;2 is replaced by x Time: 0 SEC.
compiling exported One : () -> % Time: 0 SEC.
compiling exported * : (%,%) -> % Time: 0 SEC.
(time taken in buildFunctor: 0) Time: 0 SEC.
Warnings: [1] coerce: elt has no value [2] *: elt has no value
Cumulative Statistics for Constructor MyFun Time: 0 seconds
finalizing NRLIB MYFUN Processing MyFun for Browser database: --->-->MyFun(constructor): Not documented!!!! --->-->MyFun((coerce (% (Mapping S S)))): Not documented!!!! --->-->MyFun((coerce ((Mapping S S) %))): Not documented!!!! --->-->MyFun(): Missing Description ; compiling file "/var/aw/var/LatexWiki/MYFUN.NRLIB/MYFUN.lsp" (written 14 NOV 2025 05:16:45 AM):
; wrote /var/aw/var/LatexWiki/MYFUN.NRLIB/MYFUN.fasl ; compilation finished in 0:00:00.008 ------------------------------------------------------------------------ MyFun is now explicitly exposed in frame initial MyFun will be automatically loaded when needed from /var/aw/var/LatexWiki/MYFUN.NRLIB/MYFUN
I ==> Integer
II ==> I -> I
MI ==> MyFun I
inc(i: I): I == i+1
Function declaration inc : Integer -> Integer has been added to workspace.
double(i: I): I == 2*i
Function declaration double : Integer -> Integer has been added to workspace.
minc := inc :: MI
Compiling function inc with type Integer -> Integer
LISP output: (#<FUNCTION |*1;inc;1;initial|>)
mdouble := double :: MI
Compiling function double with type Integer -> Integer
LISP output: (#<FUNCTION |*1;double;1;initial|>)
f := (mdouble * minc) :: II
g := (minc * mdouble) :: II
f 1
g 1