## Martin's beautiful idea: We can use the Aldor aldor #include "axiom" aldor Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/mymonoid.as using Aldor compiler and options -O -Fasy -Fao -Flsp -lfricas -Mno-ALDOR_W_WillObsolete -DFriCAS -Y $FRICAS/algebra -I $FRICAS/algebra Use the system command )set compiler args to change these options. The )library system command was not called after compilation. aldor #include "axiom" #library MyMonoid "mymonoid.ao"; import from MyMonoid; MyWord: with { coerce: String -> %; c:(%, aldor Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/9179840256381573157-25px002.as using Aldor compiler and options -O -Fasy -Fao -Flsp -lfricas -Mno-ALDOR_W_WillObsolete -DFriCAS -Y $FRICAS/algebra -I $FRICAS/algebra Use the system command )set compiler args to change these options. The )library system command was not called after compilation. This is what Axiom sees: fricas )sh MyMonoid fricas )sh MyWord Try it: fricas a := "Bingo"::MyWord That's pretty cool that Axiom knows But: fricas MyWord has MyMonoid(MyWord, Oops, that's Here are some more examples: aldor #include "axiom" #library MyMonoid "mymonoid.ao"; import from MyMonoid; MyInt: with { coerce: Integer -> %; +:(%, aldor Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/797595480097738355-25px006.as using Aldor compiler and options -O -Fasy -Fao -Flsp -lfricas -Mno-ALDOR_W_WillObsolete -DFriCAS -Y $FRICAS/algebra -I $FRICAS/algebra Use the system command )set compiler args to change these options. The )library system command was not called after compilation. This is what Axiom sees: fricas )sh MyInt Try it: fricas b := 3::MyInt This is very general. Notice that we can rename the monoid operation from * to +! aldor #include "axiom" #library MyMonoid "mymonoid.ao"; import from MyMonoid; MyFloat: with { coerce: DoubleFloat -> %; +:(%, aldor Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/4949806727147037492-25px009.as using Aldor compiler and options -O -Fasy -Fao -Flsp -lfricas -Mno-ALDOR_W_WillObsolete -DFriCAS -Y $FRICAS/algebra -I $FRICAS/algebra Use the system command )set compiler args to change these options. The )library system command was not called after compilation. This is what Axiom sees: fricas )sh MyFloat Try it: fricas f := 3.1::DoubleFloat::MyFloat Here's a variation on the example aldor #include "axiom" define DirProdCat(n: Integer, aldor Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/mydirprod.as using Aldor compiler and options -O -Fasy -Fao -Flsp -lfricas -Mno-ALDOR_W_WillObsolete -DFriCAS -Y $FRICAS/algebra -I $FRICAS/algebra Use the system command )set compiler args to change these options. The )library system command was not called after compilation. Try it: fricas x:= Integer; Type: Typefricas y:= NonNegativeInteger; Type: Typefricas DPx ==> DirProd(2, Type: Voidfricas DPx has DirProdCat(2, The results show that the Aldor compiler treats a domain (R) and an element of a domain (n) differently in terms of information retained for the fricas )show DirProd(2, fricas )show DirProd(2, |