"Gary Furnish" <[EMAIL PROTECTED]> writes:

> I'd be interested in hearing which features of FriCAS/OpenAxiom has that
> might be useful in more detail.  

I'm not quite sure what you are interested in.  I attach some things that I
know to be working well or that I used recently below.

> My main technical concerns are that anything interacting through a pexpect
> interface is going to be slow and will not interact with Sage's internal
> coercion system (aside from the fact that adding another dependency to the
> standard core increases code complexity for symbolics dramatically).  I
> downloaded FriCAS to try to investigate, but I couldn't find a good
> introduction to the high level structure of the FriCAS code (at the file
> level).  Does such a thing exist?

I'll restrict myself to the algebra, i.e., the part that contains the math
algorithms.  Waldek already posted the more general structure.  The algebra is
located in the files src/algebra/*.spad.pamphlet.  The name "pamphlet" is (in
my opinion) an accident and really should be "nw" for noweb.

There are several ways to investigate the algebra:

1) the axiom book by Jenks & Sutor

2) hyperdoc

3) )wh th xxx (that is, )what things xxx)

I usually start with 3.  See an example of my workflow below.  But I think it's
better to start with the principal concept of types in FriCAS/OpenAxiom, since
I have no idea how much this matches Sage's idea of type.  Below I'll write
only FriCAS, but that's the same for all members of the Axiom family and also
for Aldor, of course.

FriCAS is statically typed.  At all time, every object must have a type.  In
order to make FriCAS usable, it comes with an "intelligent" interpreter, that
tries to "guess" a reasonable type for user input.  The algorithm is relatively
transparent and general, and can be easily overridden.

Types come in 3 flavours:

an object can be

* a category (eg., Field, Monoid, MultivariateTaylorSeriesCategory) 
             Important note: the concept "category" has (in my opinion) only
             superficially to do with mathematical categories.  Rather, they
             state which operations a domain satisfying the category has to
             provide.
* a domain (eg., Integer, Float, List Integer, Matrix Complex
            Expression Integer, etc.)
* a member of a Domain (say, an integer like 3, a float like 2.7, a list of
                        integers, a Taylor series, etc.)

In principle, a function (which is a member of the domain Mapping) can return
an object of any type.  This ideal is not quite reached in FriCAS, but
completely implemented in Aldor.

Now, to explore FriCAS algebra, you need to have an idea what you are
interested in.  I believe, the best way is to look at some domains: go to
HyperDoc, browse, enter the name of a domain, eg., Set, click on "domains",
then a short description of Set should appear and a link named SET.spad.  Click
on it, if your FriCAS is correctly installed, some sort of editor or pager
should open with the source code of set in it.

Files ending with "cat.spad.pamphlet" contain most of the categories.  There
are some other naming schemas which are less consequent, like
int*.spad.pamphlet for integration.

I cannot claim to know all of the algebra.  I'd say I know roughly 20 percent -
mainly polynomials, matrices, and bits and pieces of expressions.  I guess that
a considerably large part deals with "Expressions": (I omit
.spad.pamphlet. WARNING: this list is probably incomplete and erroneous.)

the domain (and related domains) itself: fspace, expr, combfunc, kl, liouv,
             elemntry, trigcat
integration: defintef, defintrf, efstruc, intaf, intalg, intaux, intef,
             integrat, intpm, intrf, irexpand, laplace, rdesys, rderf, rdeef
series: efuls, efupxs, elfuts, expr2ups, fs2expxp, fs2ups
limits: limitps (Gruntz has been implemented by Waldek, but is not integrated
                 yet)
ODEs: exprode
pattern matching: pattern, patmatch1, patmatch2
operators on expressions: op
drawing: draw, drawopt, drawpak
solving: transsolve

Is such a list what you had in mind?

Does this answer your question?

Martin

Recently I needed to do calculus with operators.  In the following I separate
comments from FriCAS in/output with lines full of "-".

I said:
-------------------------------------------------------------------------------
(1) -> )wh th operator

Operations whose names satisfy the above pattern(s):

constantOperator    operator            operators           
quotedOperators     
   
      To get more information about an operation such as operators , 
      issue the command )display op operators 
------------------------------- Categories --------------------------------

Categories with names matching patterns:
     operator 

 LODOCAT  LinearOrdinaryDifferentialOperatorCategory
 MLO      MonogenicLinearOperator
--------------------------------- Domains ---------------------------------

Domains with names matching patterns:
     operator 

 BOP      BasicOperator
 LODO     LinearOrdinaryDifferentialOperator
 LODO1    LinearOrdinaryDifferentialOperator1
 LODO2    LinearOrdinaryDifferentialOperator2
 LODOCAT- LinearOrdinaryDifferentialOperatorCategory&
 MODOP    ModuleOperator
 OMLO     OppositeMonogenicLinearOperator
 OP       Operator
-------------------------------- Packages ---------------------------------

Packages with names matching patterns:
     operator 

 BOP1     BasicOperatorFunctions1      COMMONOP CommonOperators
 LODOF    LinearOrdinaryDifferentialOperatorFactorizer
 LODOOPS  LinearOrdinaryDifferentialOperatorsOps
 NCODIV   NonCommutativeOperatorDivision
 RECOP    RecurrenceOperator
--------------- System Commands for User Level: development ---------------

No system commands at this level matching patterns:
     operator 

------------------------- System Command Synonyms -------------------------

   No user-defined synonyms satisfying patterns:
       operator 
-------------------------------------------------------------------------------
Then I used HyperDoc to browse the individual documentation.  It turned out
that the domain "Operator" provided, what I wanted:

++ Description: Algebra of ADDITIVE operators over a ring.

(unfortunately, I cannot show HyperDoc in action here...)

In my case, I wanted to play with shift operators, acting on arbitrary
expressions.  I won't go into details, rather just show an example:
-------------------------------------------------------------------------------
(1) -> )read /tmp/axiom160050CN.input
L: OP(EXPR INT) := operator 'L
 

   (1)  L
                                            Type: Operator Expression Integer
evaluate(L, ex +-> eval(ex, 'l, 'l+1))$OP(EXPR INT)
 

   (2)  L
                                            Type: Operator Expression Integer
N: OP(EXPR INT) := operator 'N
 

   (3)  N
                                            Type: Operator Expression Integer
evaluate(N, ex +-> eval(ex, 'n, 'n+1))$OP(EXPR INT)
 

   (4)  N
                                            Type: Operator Expression Integer
op := L^2*N - q*L*N - q*L + q^2 + q^(l+1)
 

         l + 1    2                  2
   (5)  q      + q  - q L - q L N + L N
                                            Type: Operator Expression Integer
p := operator 'p
 

   (6)  p
                                                          Type: BasicOperator
op p(n,l)
 

   (7)
          l + 1                                                       2
   p(n,l)q      + p(n + 1,l + 2) - q p(n + 1,l + 1) - q p(n,l + 1) + q p(n,l)
                                                     Type: Expression Integer
-------------------------------------------------------------------------------

some showoffs:

try: (axiom is *very* good at indefinite elementary integration.  it is
currently not very good at definite integration.
-------------------------------------------------------------------------------
f := (x^2-1)/x + 1/(x+exp x)
g := D(exp(f)/exp(x),x)
integrate(g, x)
-------------------------------------------------------------------------------

types are useful:
(note that the determinant uses the correct multiplication method)
-------------------------------------------------------------------------------
(8) -> )read /tmp/axiom16005BNT.input
    l := [2,1]
 

   (8)  [2,1]
                                                   Type: List PositiveInteger
    p := partition(l)$Partition 
 


   (9)  (2 1)
                                                              Type: Partition
    m := matrix [[complete(l.j-j+i) for j in 1..#l] for i in 1..#l]
 

         +     1       1   2           +
         |     - (2) + - (1 )       [] |
         |     2       2               |
   (10)  |                             |
         |1       1         1   3      |
         |- (3) + - (2 1) + - (1 )  (1)|
         +3       2         6          +
                            Type: Matrix SymmetricPolynomial Fraction Integer
    output m
 
   +     1       1   2           +
   |     - (2) + - (1 )       [] |
   |     2       2               |
   |                             |
   |1       1         1   3      |
   |- (3) + - (2 1) + - (1 )  (1)|
   +3       2         6          +
                                                                   Type: Void
    determinant m
 

           1       1   3
   (12)  - - (3) + - (1 )
           3       3
                                   Type: SymmetricPolynomial Fraction Integer
-------------------------------------------------------------------------------

multivariate Taylor series work well:
-------------------------------------------------------------------------------
(19) -> )read /tmp/axiom16005orl.input
    X := monomial(1, x, 1)$TaylorSeries Fraction Integer
 

   (19)  x
                                          Type: TaylorSeries Fraction Integer
    Y := monomial(1, y, 1)$TaylorSeries Fraction Integer
 

   (20)  y
                                          Type: TaylorSeries Fraction Integer
    sin(X+Y)
 

   (21)
                  1  3   1    2   1  2    1  3
     (y + x) + (- - y  - - x y  - - x y - - x )
                  6      2        2       6
   + 
       1   5    1    4    1  2 3    1  3 2    1  4     1   5
     (--- y  + -- x y  + -- x y  + -- x y  + -- x y + --- x ) + O(6)
      120      24        12        12        24       120
                                          Type: TaylorSeries Fraction Integer
-------------------------------------------------------------------------------

guessing:

(22) -> l := 
[1,1,q+1,q^3+q*q+2*q+1,q^6+q^5+2*q^4+3*q^3+3*q*q+3*q+1,q^10+q^9+2*q^8+3*q^7+5*q^6+5*q^5+7*q^4+7*q^3+6*q*q+4*q+1];

                                                Type: List Polynomial Integer
(23) -> guessADE(q)(l, maxPower==2)

                        n
   (23)  [[function= [[x ]f(x): - x f(x)f(q x) + f(x) - 1= 0],order= 0]]
    Type: List Record(function: Expression Integer,order: NonNegativeInteger)

(24) -> guessBinRat [1,1,k+1,(3*k*k+5*k+2)/2,(8*k**3+18*k*k+13*k+3)/3]

                      (k + 1)n                        (k + 1)n + 1
                     (        )                      (            )
                         n                                 n
   (24)  [[function= ----------,order= 0],[function= --------------,order= 0]]
                       k n + 1                        (k + 1)n + 1
    Type: List Record(function: Expression Integer,order: NonNegativeInteger)



--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to