[Aldor-l] Aldor-Meet
Oleg Golubitsky
oleg.golubitsky at gmail.com
Wed Nov 21 13:39:55 EST 2007
Hi Ralf,
> It depends. Since both Group and RingWithOne export SemiGroup, we should
> at least have the SemiGroup property. That 1 is neutral with respect to
> the * operation should also be inherited. Unfortunately, Aldor does not
> naturally allow to specify axioms and that is a big minus. Anyway, I
> would argue that Monoid should inherit also the (currently
> aldor-invisible) axioms from the categories in the Meet.
If the set of exports *and* the set of (invisible) axioms of the category `C'
given by
define C: Category == Meet(A,B)
are completely determined by those of `A' and `B', then I do not see
anymore the point of sticking to the convention "a domain D has C if and
only if it has been explicitly declared to be a member of C". On the contrary,
I agree that all domains `D' that are members of `A' or members of `B'
should automatically satisfy `D has C'. Besides, all domains `D' that
are explicitly
declared to be members of `C' should satisfy `D has C'. The only question that
is still unclear for me is: are there any other domains that should
satisfy `D has C'?
For example, if
define C: Category == Meet(A,B);
define C2: Category == Meet(A,B);
D: C == add { ... }
E: Meet(A,B) == add { ... }
should `D has C2' be true or false?
should `E has C' be true or false?
And, speaking of the current implementation of `Meet' in Aldor, which
of the following tests are correct:
#include "aldor"
define C1:Category == with { f: Integer; g: Integer; }
define C2:Category == with { f: Integer; h: Integer; }
define Cat: Category == Meet(C1,C2);
D: Meet(C1,C2) == add { f: Integer == 1; }
E: Cat == add { f: Integer == 2; }
F: C1 == add { f: Integer == 3; g: Integer == 4; }
import from TextWriter, String, Character;
hastest(cond:Boolean):String == (if cond then " has " else " does not have ");
stdout << "D" << hastest(D has Cat) << "Cat" << newline;
stdout << "D" << hastest(D has Meet(C1,C2)) << "Meet(C1,C2)" << newline;
stdout << "E" << hastest(E has Cat) << "Cat" << newline;
stdout << "E" << hastest(E has Meet(C1,C2)) << "Meet(C1,C2)" << newline;
stdout << "F" << hastest(F has Cat) << "Cat" << newline;
stdout << "F" << hastest(F has Meet(C1,C2)) << "Meet(C1,C2)" << newline;
Output:
D does not have Cat
D does not have Meet(C1,C2)
E has Cat
E does not have Meet(C1,C2)
F does not have Cat
F does not have Meet(C1,C2)
Oleg
More information about the Aldor-l
mailing list