Hi Ric,

welcome to FriCAS.

On 02/05/2018 11:44 AM, [email protected] wrote:
> (As a sad aside, I must say that the current status of fricas installation & 
> language documentation is "sub-obtimal"

We all know. And it's sad. But there are not too many developers that
take enough care of the documentation. So help is always welcome. And
yes, if you have questions fricas-devel is the right place to pose them.

> (I can give more details if you're curious).

Yes, list them. The more complaints the higher the chance that these
problems get addressed some day.

> a:=b;
> 
> b:=1;
> 
> [a,eval(a),simplify(a)]
> 
> returns [b, b,b].
> 
> How can I force the interpreter in using the information that VALUE(b) = 1 in 
> expressions containing a?

Oh, first thing that you must understand is that FriCAS works inherently
different to most other CAS.

Let me explain what happens above.

a := b

The type is "Variable(b)". And if you look here

http://fricas.github.io/api/Variable and the respective source code that
is linked on top of this site, you see that the (programming) variable a
is assigned with a value that is a symbol.

Now if you do

b:=1

then the type is PositiveInteger, i.e. the (programming) variable b gets
an integer value. The (programming) variables a and b are not connected
in any way. Just two variables (like in C) that hold two values.

So since a is already as simple as it can be (namely a symbol that looks
like "b"), there is nothing to simplify or evaluate.

That at least explains what you see with [a,eval(a),simplify(a)].

You might want something like

(1) -> a := sin x + exp(3*x) + 1/x

                       3 x
        x sin(x) + x %e    + 1
   (1)  ----------------------
                   x
                                   Type: Expression(Integer)
(2) -> eval(a, x=u+v)

                                     3 v + 3 u
        (v + u)sin(v + u) + (v + u)%e          + 1
   (2)  ------------------------------------------
                           v + u
                                   Type: Expression(Integer)

> On the other hand Mathematica uses fixed-point infinite evaluation by default 
> so 
> it returns 1 for a.

You should understand that internally FriCAS is less symbolic than other
CAS. The underlying data structures are not just expression trees.
Take for example

http://fricas.github.io/api/SparseUnivariatePuiseuxSeries.html

https://github.com/hemmecke/fricas/blob/master-hemmecke/src/algebra/sups.spad#L1690

Internally it is represented by a record of a fractional power and a
univariate Laurent series. And you can certainly look deeper into how
http://fricas.github.io/api/SparseUnivariateLaurentSeries.html
is represented.

In fact, internally FriCAS is much closer to C than one would expect.
The power of FriCAS lies also in having data structures for the objects
that are particularly tailored for the algorithms that are then applied
to these objects.

For example, tell me a CAS that distinguishes between a (multivariate)
polynomial that is "distributed" (i.e. stored as a list of pairs where
each pair consists of a coefficient and the corresponding exponent
vector of the variables) or that is "recursive" (i.e. it is a
(univariate) polynomial in the main variable whose coefficients are
(recursive) polynomials in the other variables.

> Is there a better way to get 1 from a, or maybe not having it is a feature of 
> the language?

Hard to say. I consider your example as just something that told you
that FriCAS behaves very differently from Mathematica. In order to help
you, you should try to explain exactly what you want to achieve with
FriCAS. Posing specific questions makes it easier to help you.

> PS sorry if you received also an early version of this email, the first trial 
> seemed to be blocked/delayed. Please ignore it.

To prevent spam, first time posters are moderated. Now your posts will
go through immediately. Sorry that I've just seen you second message and
missed the first one.

Ralf

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to