axiom-developer
[Top][All Lists]
Advanced

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

RE: [SAGEdev] [Axiom-developer] Sage on MathAction


From: Page, Bill
Subject: RE: [SAGEdev] [Axiom-developer] Sage on MathAction
Date: Wed, 16 Aug 2006 16:58:35 -0400

On Wednesday, August 16, 2006 12:40 PM William Stein wrote:
> On Wed, 16 Aug 2006 07:02:03 -0700, Bill Page wrote:
> > So I am very enthusiastic about the idea of developing a serious
> > Axiom interface for Sage and I hope we can find more resources
> > here in the Axiom developer group to work on this. I have read
> > most of the Sage Maxima interface code and I think it forms a
> > pretty good basis on which to start to build an Axiom interface.
> >
> > Is anyone interested?
> 
> Well I definitely am interested.  I've already started thinking
> about writing an interface.

Wonderful!

> Here are some quick questions to get things started:
> 
>     -- Is there a way to get a list of all the types that are
>        defined in a given Axiom session?

The Axiom command: )display will provide some useful information.

 )display      : display Library operations and objects in your
workspace

E.g.

---------

(1) -> I:Integer
                                Type: Void
(2) -> S:String
                                Type: Void
(3) -> M:Matrix Integer
                                Type: Void
(4) -> f(x)==x+1
                                Type: Void
(5) -> g:(Integer,Float)->String
                                Type: Void
(6) -> g(x,y)==unparse((y^x)::InputForm)
                                Type: Void
(6) -> )display properties
Properties of % :
   Value (has type Void):  "()"
Properties of %e :
   This is a system-defined macro.
   macro %e () == exp(1)
Properties of %i :
   This is a system-defined macro.
   macro %i () == complex(0,1)
Properties of %infinity :
   This is a system-defined macro.
   macro %infinity () == infinity()
Properties of %minusInfinity :
   This is a system-defined macro.
   macro %minusInfinity () == minusInfinity()
Properties of %pi :
   This is a system-defined macro.
   macro %pi () == pi()
Properties of %plusInfinity :
   This is a system-defined macro.
   macro %plusInfinity () == plusInfinity()
Properties of I :
   Declared type or mode:   Integer
Properties of M :
   Declared type or mode:   Matrix Integer
Properties of S :
   Declared type or mode:   String
Properties of SF :
   This is a system-defined macro.
   macro SF () == DoubleFloat()
Properties of f :
   This is an interpreter function.
   Definition:   f x == x + 1
Properties of g :
   Declared type or mode:   ((Integer,Float) -> String)
   This is an interpreter function.
   This depends on the following functions or rules:
      String OutputForm concat string latex Float InputForm unparse
                                      x
   Definition:   g (x,y) == unparse((y ) :: InputForm)

--------

>     -- Is there a way to change the prompts, i.e., to be much
>        more difficult to confuse with valid output?

Here is one way involving specifying a "frame" with a odd name
and using that name in the prompt. (Frames are separate named
workspaces.)

E.g.
---------

(1) -> )set message prompt verbose
initial [14:59:53] [1] -> )frame new <-\begin{sage-input}
<-\begin{sage-input} [15:01:04] [1] -> )set message autoload off
<-\begin{sage-input} [15:01:20] [1] -> )set output algebra off
<-\begin{sage-input} [15:01:29] [1] -> )set output tex on
<-\begin{sage-input} [15:01:56] [1] -> 1/2

$$
1 \over 2
\leqno(1)
$$

                                                       Type: Fraction
Integer
<-\begin{sage-input} [15:02:00] [2] -> integrate(sin(x)^2,x)

$$
{-{{\cos
\left(
{x}
\right)}
\  {\sin
\left(
{x}
\right)}}+x}
\over 2
\leqno(2)
$$

                                          Type: Union(Expression
Integer,...)
<-\begin{sage-input} [15:02:44] [3] ->

----------

>     -- If X is an Axiom variable, is there a way to ask the 
>        Axiom command line for a list of function that take X as
>        the first argument?

Hmmm... I don't think so. What do you mean by "take X"? Do you
mean the type of X? But see ')display properties' output above
for functions. There is also

  )show         : show constructor information

E.g.

  )show Integer

and

  )display operations

In addtion to these standard commands it may be possible to
call some of the underlying lisp functions which are used, by
other user interfaces such as Axiom's browser HyperTex.

>     -- Could you give me an example that illustrates "exec"'ing
>        the contents of a text file from within Axiom?  (This
>        sort of thing is used by SAGE when input lines are huge.)
> 

The usual command is

  )read filename.input

This reads interpreter commands from the named file.
There are also compiler commands which might be relevant.

  )compile filename.spad
  )compile filename.as
  )compile filename.lisp

SPAD (.spad) and Aldor (.as) are the Axiom library programming
languages.

I hope this helps.

Regards,
Bill Page. 




reply via email to

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