login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for SandboxIsomorphic revision 1 of 1

1
Editor: hemmecke
Time: 2008/11/14 05:50:36 GMT-8
Note:

changed:
-
This page deals with specification of isomorphic domains.

See thread http://groups.google.com/group/fricas-devel/browse_thread/thread/ed7004a07ae07461
\begin{aldor}
#include "aldor"
#include "aldorio"

define IsIsomorphicTo(C: Category, T: C): Category == with {
	coerce: % -> T
}

-- abelian monoid with a distinguished element.
AbelianMonoid1: Category == with {
	0: %;
	1: %; -- a distinguished element (generator)
	+: (%, %) -> %;
}

-- Integers
Dom1: AbelianMonoid1 == add {
	Rep == Integer;
	import from Rep;
	0: % == per 0;
	1: % == per 1;
	(x: %) + (y: %): % == per(rep x + rep y);
}

-- Even integers
Dom2: AbelianMonoid1 == add {
	Rep == Integer;
	import from Rep;
	0: % == per 0;
	1: % == per 2;
	(x: %) + (y: %): % == per(rep x + rep y);
}

-- Integers represented as sticks.
DomS: AbelianMonoid1 == add {
	Rep == String;
	import from Rep;
	0: % == per "";
	1: % == per "|";
	(x: %) + (y: %): % == per(rep x + rep y);
}

extend Dom1: IsIsomorphicTo(AbelianMonoid1, Dom2) == add {
	coerce(x: %): Dom2 == never;
}
extend Dom2: IsIsomorphicTo(AbelianMonoid1, DomS) == add {
	coerce(x: %): DomS == never;
}
extend DomS: IsIsomorphicTo(AbelianMonoid1, Dom1) == add {
	coerce(x: %): Dom1 == never;
}
\end{aldor}

Some tasks:

1. Give implementations instead of 'never'.

1. Give a **uniform** implementation instead of 'never' that works for any Domain 'DomX'.


This page deals with specification of isomorphic domains.

See thread http://groups.google.com/group/fricas-devel/browse_thread/thread/ed7004a07ae07461

aldor
#include "aldor"
#include "aldorio"
define IsIsomorphicTo(C: Category, T: C): Category == with { coerce: % -> T }
-- abelian monoid with a distinguished element. AbelianMonoid1: Category == with { 0: %; 1: %; -- a distinguished element (generator) +: (%, %) -> %; }
-- Integers Dom1: AbelianMonoid1 == add { Rep == Integer; import from Rep; 0: % == per 0; 1: % == per 1; (x: %) + (y: %): % == per(rep x + rep y); }
-- Even integers Dom2: AbelianMonoid1 == add { Rep == Integer; import from Rep; 0: % == per 0; 1: % == per 2; (x: %) + (y: %): % == per(rep x + rep y); }
-- Integers represented as sticks. DomS: AbelianMonoid1 == add { Rep == String; import from Rep; 0: % == per ""; 1: % == per "|"; (x: %) + (y: %): % == per(rep x + rep y); }
extend Dom1: IsIsomorphicTo(AbelianMonoid1, Dom2) == add { coerce(x: %): Dom2 == never; } extend Dom2: IsIsomorphicTo(AbelianMonoid1, DomS) == add { coerce(x: %): DomS == never; } extend DomS: IsIsomorphicTo(AbelianMonoid1, Dom1) == add { coerce(x: %): Dom1 == never; }
aldor
   Compiling FriCAS source code from file 
      /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/5159550970087145340-25px001.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.

Some tasks:

  1. Give implementations instead of never.
  2. Give a uniform implementation instead of never that works for any Domain DomX.