axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] Re: Aldor and Axiom


From: Ralf Hemmecke
Subject: Re: [Axiom-developer] Re: Aldor and Axiom
Date: Wed, 15 Feb 2006 14:58:19 +0100
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050722)

Since there is no definition of "Integer" in that file, the compiler must
know about that thing or it must look into integer.spad to find what Integer
stands for. Yes, yes, I know, here the whole business of circular
dependencies begins. I guess, finally, Integer will be an abelian group
itself. ;-)

But as far as I know, for Aldor this situation was abstracted and there is now
a keyword for dealing with it, I believe it is "extend".

Right. If you look at the sources of libaldor it starts with lib/aldor/src/lang/sal_lang.as and then lib/aldor/src/base/sal_base.as.

Interestingly, in the latter file there is some interdependency.

define PrimitiveType: Category == with {
        =: (%, %) -> Boolean;
        ~=: (%, %) -> Boolean;
        default { (a:%) ~= (b:%):Boolean == ~(a = b); }
}

Boolean: PrimitiveType with {
        ~: % -> %;
        coerce: Bool -> %;
        coerce: % -> Bool;
        false:%;
        true:%;
} == add {
        Rep == Bool;
        coerce(b:%):Bool        == rep b;
        coerce(b:Bool):%        == per b;
        false:%                 == address@hidden :: %;
        true:%                  == address@hidden :: %;
        ~(x:%):%                == (~(x::Bool))::%;
        (a:%) = (b:%):%         == (rep a = rep b)::%;
        (a:%) ~= (b:%):%        == (rep a ~= rep b)::%;
}

But obviously, the Aldor compiler can handle this.

Let us suppose the following scenario. I remove any file from src/algebra/
and any corresponding Makefile entry. Then I start compiling Axiom. Would I
end up with an Axiom framework that has no mathematical knowledge.

Probably not.


Well, I do think so, at least roughly. In fact, as far as I know, debugsys does
something similar.

Should I know debugsys?

Furthermore, Tim Daly analysed the circular dependencies to know in which
"layer" any given domain is. You can see this in the file lattice.pamphlet on
MathAction or in src/algebre/Makefile.

Thanks. I'll take a look.

The interpreter needs something like OutputForm in order to print something
reasonable on the screen. Is this type builtin?


No, it is defined in outform.spad. And, as long as you don't have a coercion
function to OUTFORM, you don't need it anyway :-)

Without OUTFORM, you can print using the Lisp function "print".

But how does the Interpreter show the result? Doesn't it rely on the fact that a domain satisfies CoercibleTo(OutputForm)?

For example, if you write a file

---MyInt.spad
)abbr domain MYI MyInt
MyInt: with
  x: %
 == Integer add
  x: % == 1
---END

Then
)co MyInt.spad
x:MyInt

it prints just Type: Void but no other output.

So in order to have a reasonable input/output behaviour on the Axiom command line, I should meet certain criteria. Is that written somewhere?
References?

Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]