[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiom-developer] BINGO, Curiosities with Axiom mathematical structures
From: |
Martin Rubey |
Subject: |
[Axiom-developer] BINGO, Curiosities with Axiom mathematical structures |
Date: |
09 Mar 2006 17:08:29 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 |
I am satisfied now:
-------------------------------------------------------------------------------
#include "axiom"
MyMonoid(T: Type, m: (T, T) -> T): Category == with {
square: T-> T;
default {square(t: T): T == m(t, t)}
}
MyWord: with {
coerce: String -> %;
c:(%, %) -> %
}
== add {
Rep == String;
import from String;
coerce(a: String): % == per(a);
c(a: %, b: %):% == coerce(concat(rep(a), rep(b))$String) }
import from MyWord;
extend MyWord: MyMonoid(MyWord, c) == add;
-------------------------------------------------------------------------------
The only slight inconvenience is that we need to have the domain itself as
parameter of the category, too. But I think that's ok, given that there is no
need to change the compiler in any way. I'll post this on SandboxMonoid as
well.
-------------------------------------------------------------------------------
AXIOM Computer Algebra System
Version: Axiom 3.9 (September 2005)
Timestamp: Monday October 31, 2005 at 16:30:26
-----------------------------------------------------------------------------
Issue )copyright to view copyright notices.
Issue )summary for a summary of useful system commands.
Issue )quit to leave AXIOM and return to shell.
-----------------------------------------------------------------------------
Re-reading compress.daase Re-reading interp.daase
Re-reading operation.daase
Re-reading category.daase
Re-reading browse.daase
(1) ->
(1) -> )co test.as
(1) -> )sh MyMonoid
MyMonoid(T: Type,m: ((T,T) -> T)) is a category constructor
Abbreviation for MyMonoid is MYMONOI
This constructor is exposed in this frame.
Issue )edit test.as to see algebra source code for MYMONOI
------------------------------- Operations --------------------------------
square : T -> T
(1) -> )sh MyWord
MyWord is a domain constructor
Abbreviation for MyWord is MYWORD
This constructor is exposed in this frame.
Issue )edit test.as to see algebra source code for MYWORD
------------------------------- Operations --------------------------------
c : (%,%) -> % coerce : String -> %
square : MyWord -> MyWord
(1) -> a := "Bingo"::MyWord
LISP output:
Bingo
Type: MyWord
(2) -> square a
LISP output:
BingoBingo
Type: MyWord
(3) -> MyWord has MyMonoid(MyWord, c)
(3) true
- Re: [Axiom-developer] Curiosities with Axiom mathematical structures, (continued)
- Re: [Axiom-developer] Curiosities with Axiom mathematical structures, William Sit, 2006/03/02
- Re: [Axiom-developer] Curiosities with Axiom mathematical structures, Gabriel Dos Reis, 2006/03/02
- Re: [Axiom-developer] Curiosities with Axiom mathematical structures, William Sit, 2006/03/04
- Re: [Axiom-developer] Curiosities with Axiom mathematical structures, Ralf Hemmecke, 2006/03/07
- Re: [Axiom-developer] Curiosities with Axiom mathematical structures, William Sit, 2006/03/07
- Re: [Axiom-developer] Curiosities with Axiom mathematical structures, Martin Rubey, 2006/03/08
- Re: [Axiom-developer] Curiosities with Axiom mathematical structures, Ralf Hemmecke, 2006/03/09
- Re: [Axiom-developer] Curiosities with Axiom mathematical structures, Martin Rubey, 2006/03/09
- [Axiom-developer] BINGO, Curiosities with Axiom mathematical structures,
Martin Rubey <=
- Re: [Axiom-developer] BINGO,Curiosities with Axiom mathematical structures, William Sit, 2006/03/09
- Re: [Axiom-developer] BINGO, Curiosities with Axiom mathematical structures, Ralf Hemmecke, 2006/03/10
- Re: [Axiom-developer] BINGO,Curiosities with Axiom mathematical structures, William Sit, 2006/03/10
- Re: [Axiom-developer] BINGO, Curiosities with Axiom mathematical structures, Gabriel Dos Reis, 2006/03/13
- RE: [Axiom-developer] BINGO, Curiosities with Axiom mathematical structures, Bill Page, 2006/03/09
- Re: [Axiom-developer] BINGO,Curiosities with Axiom mathematical structures, William Sit, 2006/03/10
- Re: [Axiom-developer] BINGO, Curiosities with Axiom mathematical structures, Gabriel Dos Reis, 2006/03/13
- [Axiom-developer] Re: BINGO, Curiosities with Axiom mathematical structures, Martin Rubey, 2006/03/10
- Re: [Axiom-developer] Curiosities with Axiom mathematical structures, Ralf Hemmecke, 2006/03/09
- RE: [Axiom-developer] Curiosities with Axiom mathematical structures, Bill Page, 2006/03/10