axiom-developer
[Top][All Lists]
Advanced

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

Re: [Axiom-developer] spad: language and compiler


From: William Sit
Subject: Re: [Axiom-developer] spad: language and compiler
Date: Wed, 30 Aug 2006 06:15:54 -0400

On 24 Aug 2006 14:38:19 +0200
 Martin Rubey <address@hidden> wrote:
Ralf Hemmecke <address@hidden> writes:

> f(m: INT, n: INT): PF n == m::PF(n)
that's OK.


> [f(100, n) for n in primes(1,100)]
that's stupid.

Why? I would think it is an element (not a list) in a cartesian product of #primes(1,100) prime fields.

Ask yourself, what type that list will have and you realise that Aldor will
reject that its compilation.
Excuse me, Gaby. Sorry about being so stupid.

It's a perfectly good mathematical object in a cartesian product.


> [a::P for P in L]
That is as problematic as the first list.
"problematic" is an understatement. Sorry.

Ditto. The only problem I see that can't be handled is if you make it into a function of k:

[f(100, n) for n in primes(1,k)]

To have true dependent types means the compiler should be able to handle

[f(100, n) for n in primes(1,100)]

because the list primes(1,100) is computable at compile time and hence the prime fields can be constructed and their cartesian product too. prime(1,k) is a totally different ball game, but even that should be doable with generated code to instantiate the prime fields when k is given a value at run time.

William




reply via email to

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