axiom-developer
[Top][All Lists]
Advanced

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

[Axiom-developer] [DynamicFunctionDomains]


From: Bill Page
Subject: [Axiom-developer] [DynamicFunctionDomains]
Date: Thu, 13 Jan 2005 14:54:32 -0600

++added:
Compiling g is still a problem in Axiom due to
signature limitation. At least this way, inlining
a complicated function is almost like a function call.

The idea is: Since in creating domains (or any other
types of constructors), we are in effect creating a
function(the domain constructor PPF is a function of
sort, or functor) and the compiler can take dependent
types in its signature,structurally::

  PPF(n:PositiveInteger)==PrimeField(n) with foo

so it should be able to compile something like g by
lifting it to the package level.

So here is another way using package.

\begin{axiom}
)abbrev package FOO Foo
--%Foo
Foo(n:PositiveInteger, k:PositiveInteger):T==C where
  T == with
       point:()->PrimeField(n)
  C == add
       point()==k::Integer::PrimeField(n)
\end{axiom}

After compiling, we can use::

  point()$Foo(n,k)

in any computation in compiler code (and in interpreter). Still
can't call this bar(n,k) unless you use a macro expansion:

\begin{axiom}
bar ==>point()$Foo
bar(4,7)
\end{axiom}

Can someone give an example where the *signature* of bar::

  bar: (n: PositiveInteger, k: PositiveInteger) -> PrimeField(n)

is actually needed?


--
forwarded from http://page.axiom-developer.org/zope/mathaction/address@hidden




reply via email to

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