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

Edit detail for SandBox Aldor Join and Meet revision 4 of 9

1 2 3 4 5 6 7 8 9
Editor: page
Time: 2007/11/19 18:51:10 GMT-8
Note: Axiom library does not define 'Meet'

added:
Meet(T: Tuple Category): Category == with;


added:
}
D1: C1 == add {
  f: Integer == 1;
  g: Integer == 2;

changed:
-D: Meet(C1,C2) == add {
-       f: Integer == 1;  -- OK; if this line is commented out, error:
-                               -- The domain is missing some exports.
-                               -- Missing f: AldorInteger
D2: C2 == add {
  f: Integer == 1;
  h: Integer == 3;

added:

define M12:Category == Meet(C1,C2);

DM12: M12 == add {
  f: Integer == 1;  -- if this line is commented out, error:
                    -- The domain is missing some exports.
  g: Integer == 2;
  h: Integer == 3;

}

define J12:Category == Join(C1,C2);

DJ12: J12 == add {
  f: Integer == 1;
  g: Integer == 2;
  h: Integer == 3;
}

main1():Record(D1hasM12:Boolean,D2hasM12:Boolean) ==
  [D1 has M12, D2 has M12];
main2():Record(M12hasC1:Boolean,DM12hasC2:Boolean) ==
  [DM12 has C1, DM12 has C2];
main3():Record(DH12hasC1:Boolean, DJ12hasC2:Boolean) ==
  [DJ12 has C1, DJ12 has C2];

added:
\begin{axiom}
f()$DM12
-- expect not defined
g()$DM12
-- expect not defined
h()$DM12
f()$DJ12
g()$DJ12
h()$DJ12
\end{axiom}

\begin{axiom}
-- expect False, False
main1()
-- expect True, True
main2()
-- expect True, True
main3()
\end{axiom}


Aldor-Meet

On Date: Nov 19, 2007 10:58 AM Oleg Golubitsky wrote to aldor-l :

By analogy with Join, Meet(C1,C2) should return a category which has the intersection of exports of C1 and C2.

A simple test (see below) confirmed this semantics; I also could not find a description of Meet in the guide.

aldor
#include "aldor" define C1:Category == with { f: Integer; g: Integer; } define C2:Category == with { f: Integer; h: Integer; } D: Meet(C1,C2) == add { f: Integer == 1; -- OK; if this line is commented out, error: -- The domain is missing some exports. -- Missing f: AldorInteger }
aldor
   Compiling FriCAS source code from file 
      /var/zope2/var/LatexWiki/2046275806961882305-25px001.as using 
      AXIOM-XL compiler and options 
-O -Fasy -Fao -Flsp -laxiom -Mno-AXL_W_WillObsolete -DAxiom -Y $AXIOM/algebra
      Use the system command )set compiler args to change these 
      options.
#1 (Warning) Deprecated message prefix: use `ALDOR_' instead of `_AXL'
   Compiling Lisp source code from file 
      ./2046275806961882305-25px001.lsp
   Issuing )library command for 2046275806961882305-25px001
   Reading /var/zope2/var/LatexWiki/2046275806961882305-25px001.asy
   C1 is now explicitly exposed in frame initial 
   C1 will be automatically loaded when needed from 
      /var/zope2/var/LatexWiki/2046275806961882305-25px001
   C2 is now explicitly exposed in frame initial 
   C2 will be automatically loaded when needed from 
      /var/zope2/var/LatexWiki/2046275806961882305-25px001
   D is now explicitly exposed in frame initial 
   D will be automatically loaded when needed from 
      /var/zope2/var/LatexWiki/2046275806961882305-25px001

The Axiom library apparently does not define Meet.

aldor
#include "axiom" Meet(T: Tuple Category): Category == with; define C1:Category == with { f: Integer; g: Integer; } D1: C1 == add { f: Integer == 1; g: Integer == 2; } define C2:Category == with { f: Integer; h: Integer; } D2: C2 == add { f: Integer == 1; h: Integer == 3; } define M12:Category == Meet(C1,C2); DM12: M12 == add { f: Integer == 1; -- if this line is commented out, error: -- The domain is missing some exports. g: Integer == 2; h: Integer == 3; } define J12:Category == Join(C1,C2); DJ12: J12 == add { f: Integer == 1; g: Integer == 2; h: Integer == 3; } main1():Record(D1hasM12:Boolean,D2hasM12:Boolean) == [D1 has M12, D2 has M12]; main2():Record(M12hasC1:Boolean,DM12hasC2:Boolean) == [DM12 has C1, DM12 has C2]; main3():Record(DH12hasC1:Boolean, DJ12hasC2:Boolean) == [DJ12 has C1, DJ12 has C2];
aldor
   Compiling FriCAS source code from file 
      /var/zope2/var/LatexWiki/2783739192216117590-25px002.as using 
      AXIOM-XL compiler and options 
-O -Fasy -Fao -Flsp -laxiom -Mno-AXL_W_WillObsolete -DAxiom -Y $AXIOM/algebra
      Use the system command )set compiler args to change these 
      options.
#1 (Warning) Deprecated message prefix: use `ALDOR_' instead of `_AXL'
   Compiling Lisp source code from file 
      ./2783739192216117590-25px002.lsp
   Issuing )library command for 2783739192216117590-25px002
   Reading /var/zope2/var/LatexWiki/2783739192216117590-25px002.asy
   C1 is already explicitly exposed in frame initial 
   C1 will be automatically loaded when needed from 
      /var/zope2/var/LatexWiki/2783739192216117590-25px002
   C2 is already explicitly exposed in frame initial 
   C2 will be automatically loaded when needed from 
      /var/zope2/var/LatexWiki/2783739192216117590-25px002
   J12 is now explicitly exposed in frame initial 
   J12 will be automatically loaded when needed from 
      /var/zope2/var/LatexWiki/2783739192216117590-25px002
   M12 is now explicitly exposed in frame initial 
   M12 will be automatically loaded when needed from 
      /var/zope2/var/LatexWiki/2783739192216117590-25px002
   DJ12 is now explicitly exposed in frame initial 
   DJ12 will be automatically loaded when needed from 
      /var/zope2/var/LatexWiki/2783739192216117590-25px002
   DM12 is now explicitly exposed in frame initial 
   DM12 will be automatically loaded when needed from 
      /var/zope2/var/LatexWiki/2783739192216117590-25px002
   D1 is now explicitly exposed in frame initial 
   D1 will be automatically loaded when needed from 
      /var/zope2/var/LatexWiki/2783739192216117590-25px002
   Meet is now explicitly exposed in frame initial 
   Meet will be automatically loaded when needed from 
      /var/zope2/var/LatexWiki/2783739192216117590-25px002
   D2 is now explicitly exposed in frame initial 
   D2 will be automatically loaded when needed from 
      /var/zope2/var/LatexWiki/2783739192216117590-25px002

axiom
f()$DM12
LatexWiki Image(1)
Type: Integer
axiom
-- expect not defined g()$DM12 The function g is not implemented in DM12 . -- expect not defined h()$DM12 The function h is not implemented in DM12 . f()$DJ12
LatexWiki Image(2)
Type: Integer
axiom
g()$DJ12
LatexWiki Image(3)
Type: Integer
axiom
h()$DJ12
LatexWiki Image(4)
Type: Integer

axiom
-- expect False, False main1()
LatexWiki Image(5)
Type: Record(D1hasM12: Boolean,D2hasM12: Boolean)
axiom
-- expect True, True main2()
LatexWiki Image(6)
Type: Record(M12hasC1: Boolean,DM12hasC2: Boolean)
axiom
-- expect True, True main3()
LatexWiki Image(7)
Type: Record(DH12hasC1: Boolean,DJ12hasC2: Boolean)