Re: [fricas-devel] Re: Debian package on github?

2022-04-22 Thread Riccardo GUIDA

Hi Ralf

In principle, in *every* linux distribution one can:

1) install the powerful nix package manager (This in general is easily done 
manually, but in Debian >= bulleyes official packages are available, see [1])

2) use nix to install and regularly update fricas (1.3.7 is available in 
nixpkgs stable [2]). The simple file default.nix controls the compilation on 
nix side: it shows that sbcl is used [3].

Notes:
- in "nix on Debian" setup the nix packages are stored in a folder different 
from standard Debian's one.
- the fricas nix package has currently not a fully fledged maintainer and, in 
case of delay, one should ask for updates to the nix newsgroup.
- jfricas is not in nix, so one should use also pythonic package managers.

I planned to use this method but then I went for direct compilation (thanks to 
your kind help).

Cheers
riccardo

REFS:
* [1] https://packages.debian.org/bullseye/nix-setup-systemd
* [2] 
https://search.nixos.org/packages?channel=21.11&from=0&size=50&sort=relevance&type=packages&query=fricas
* [3] 
https://github.com/NixOS/nixpkgs/blob/nixos-21.11/pkgs/applications/science/math/fricas/default.nix#L15

--
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 fricas-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/45d6b689-f967-392c-dbf9-73f6c4594581%40gmail.com.


[fricas-devel] Mathcad 6.0 relies on Fricas

2019-11-05 Thread Riccardo GUIDA

Hello,

just for your info (and maybe for the website): it seems that Mathcad Prime 6.0 
Symbolic Engine uses FriCAS as symbolic engine.

https://community.ptc.com/t5/PTC-Mathcad/Mathcad-Prime-6-0-Symbolic-Engine-based-on-Axiom-Fricas/m-p/629190

best regards
Riccardo

--
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 fricas-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/3a709e7b-3a24-da66-0625-87724af0d691%40gmail.com.


Re: Re: [fricas-devel] book.pdf for fricas 1.3.5 ?

2019-04-02 Thread Riccardo GUIDA

Thanks for the updated docs Ralf!

riccardo

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/b56ba1cc-5352-0f9e-663e-39d3d795fbdb%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] book.pdf for fricas 1.3.5 ?

2019-03-15 Thread Riccardo GUIDA

Hi to all!

If I understand correctly, the current version of book.pdf in fricas.github.io 
is not in sync with patches in the docs introduced in 1.3.5 .

Are there any problems in this sense?

riccardo

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/6b68f904-ee9f-bfc5-ea20-ccbeef242e17%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] strange sum error

2019-02-05 Thread Riccardo GUIDA

Reproduced in 1.3.4
ric
PS btw thanks Waldek and you all for 1.3.5

   FriCAS Computer Algebra System
Version: FriCAS 1.3.4
  Timestamp: Wed Jun 27 13:40:07 CEST 2018
-
   Issue )copyright to view copyright notices.
   Issue )summary for a summary of useful system commands.
   Issue )quit to leave FriCAS and return to shell.
-
 
   Type: Void


(1) -> sum(sum(a^k, a=1..k), k=1..n)
   - log(%C)
 
   >> Error detected within library code:

   Hidden constant detected

(1) -> sum(sum(a^k, a=1..k), k=1..10)
   - log(%C)
 
   >> Error detected within library code:

   Hidden constant detected

(1) -> sum(a^k, a=1..k)

  k
 ──┐k
   (1)   > a
 ──┘
a = 1
Type: Expression(Integer)
(2) -> f(k)==sum(a^k, a=1..k)
   Type: Void
(3) -> sum(f(k), k=1..n)
   Compiling function f with type Variable(k) -> Expression(Integer)
   - log(%C)
 
   >> Error detected within library code:

   Hidden constant detected

(3) -> f(3)
   Compiling function f with type PositiveInteger -> Fraction(
  Polynomial(Integer))

   (3)  36
  Type: Fraction(Polynomial(Integer))
(4) ->

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/22fd4bb3-6551-54d0-f451-9e23e595a7ee%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] Re: Simple Gaussian integral fails

2018-11-08 Thread Riccardo GUIDA

1) Why does not sqrt(a^2) return abs(a)?


IIUC:

When operating on a symbolic expression x in Expression R,
the operator sqrt "represents an arbitrary (but always the same through the code) 
solution y of the algebraic equation y^2=x".
Even when R = Integer, there are still 2 real roots y that satisfy the equation.

Similar semantics for the n-th root nthRoot:
"an arbitrary (but always the same through the code) solution of the algebraic 
equation y^n=x".

Note that sqrt(x) may not be imagined to be a set with two elements
because the (pointwise) product of two sets would be a set including also
non-diagonal products of the elements.
(IE sqrt(4)={+2,-2} ==> sqrt(4)*sqrt(4) = {(+2)*(+2),...} = {+4, -4}).

So, FriCAS deliberately tries not to make a choice of roots
and consequently sqrt has a different semantics (on expressions)
as compared to all other CAS in my knowledge.

As for the (sometimes) weird behavior of abs in FriCAS
this should be related to the fact that using a smart abs one might construct 
zero divisors,
(nonzero  x1,x2 such that x1 * x2 = 0). This would violate the fact that 
Expression Integer
is meant to be a differential field, which is essential for the indefinite 
integration algorithms.
To recover more information I advice you to track the above keywords in the 
past messages:
many of your (present and future) questions have been already asked many times 
in the last 10 years.

riccardo

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] Re: Re: Simple Gaussian integral fails

2018-11-08 Thread Riccardo GUIDA



On 11/8/18 1:05 PM, Marduk wrote:

3) How can one tell FriCAS that a>0 in the Gaussian integral?


Write a=A^2 :

(1) -> inf ==> %plusInfinity; integrate(exp(-A^4*x^2),x=-inf..inf)

 ┌───┐
\│%pi
   (1)  ──
   2
  A
  Type: Union(f1: OrderedCompletion(Expression(Integer)),...)


another sad physicist...


--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] friCAS API: weird eval signature?

2018-09-17 Thread Riccardo GUIDA

Hi to all. This is mainly for Ralf.

In
http://fricas.github.io/api/FunctionSpace.html#l-function-space
I read:
eval: (%, List Symbol, List NonNegativeInteger, List List % -> %) -> % if R has 
Ring
eval(x, [s1, ..., sm], [n1, ..., nm], [f1, ..., fm])
replaces every si(a1, ..., an)^ni in x by fi(a1, ..., an) for any a1, …, am.

Now, if function application without parentheses is right associating (ie 'f g 
x = f(g(x)')
I parse
List List % -> %
above as
( List (List %) ) -> %
or
List( List (% -> %) )
depending on the binding strength of '->'.
(Guess is the former case, ie '->' is weaker than function application.)

But in
https://github.com/hemmecke/fricas/blob/master-hemmecke/src/algebra/fspace.spad#L494
I see:
 eval : (%, List SY, List N, List(List % -> %)) -> %
   ++ eval(x, [s1, ..., sm], [n1, ..., nm], [f1, ..., fm]) replaces
   ++ every \spad{si(a1, ..., an)^ni} in x by \spad{fi(a1, ..., an)}
++ for any a1, ..., am.

which seems to suggest that the correct parsing is different from the previous 
two, ie:
List( List(%) -> % )

Am I missing something or there is a real problem?

Riccardo

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re:Re: Re: [fricas-devel] weird primitive

2018-09-12 Thread Riccardo GUIDA

Waldek:

Unfortunately no.  You have equalty when additionaly real parts of
z1 and z2 are nonnegative.  But in whole D things are "interesting".




Your claim (1) shows that principal branch creates traps that
normal users do not see.  So "familiar" should be taken with
grain of salt.


Upss  ...  that *was* familiar some time ago... SHAME ON ME!!

DLMF [10] says that it should be correct to replace
"if z1*z2 in D" in (1)
by
"if pi< arg(z1)+arg(z2) <= pi"

Well, whatever, the point was to use (correct) identities by default
in PrincipalBranchExpression.
 



Waldek:

Actually, you have the some trouble with (2) as with (1).


More nonsense of mine?
I thought that (2) was OK  in polar coordinates z~(r,phi)
for the "log -manifold" and with
log z(r,phi) := log r + i phi
z1*z2 := ( z1.r * z2.r, z1.phi + z2.phi )
... but maybe you mean if we work on complex patches homemorphic to C-cut.



Waldek:

Users are brainwashed to accept principal branches, but
in most applications we deal with continous functions.
That is, correct branch is one leading to continous
function.  So, much of complexity (unsolvability!)
introduced by principal branches really is useless
and does not correspond to real world.  Part of
branch cut complications is due to using wrong
model, that is pretending that we are working
on euclidean space when we should work with manifolds.


sounds elegant, but is that doable in a CAS?

Waldek:

Well, how you define 'x^a'?  I am aware of only one FriCAS domain
which defines 'x^a' for irrational 'a' differently than via 'exp'.
The exception is SmallOrdinal and you could argue that ordinals
are in some sense "rational".


OK, so for irrational 'a' FriCAS  defines
  
x^a := e^{a log(x)}


but does this definition hold (in FriCAS) also for rational 'a' and in 
particular 'a = 1/n'?

I mean, I'm confused by my tests below

(1) -> (2^sqrt(3) = e^(sqrt(3)*log(2)))::Boolean

   (1)  false
Type: Boolean
(2) -> (2^(1/3) = e^(1/3*log(2)))::Boolean

   (2)  false
Type: Boolean
(3) -> (2^(5/3) = e^(5/3*log(2)))::Boolean

   (3)  false
Type: Boolean
(4) -> (1^sqrt(3) = e^(sqrt(3)*log(1)))::Boolean

   (4)  false
Type: Boolean
(5) -> (1^(5/3) = e^(5/3*log(1)))::Boolean

   (5)  true
Type: Boolean
(6) -> (1^(1/3) = e^(1/3*log(1)))::Boolean

   (6)  true
Type: Boolean
--- below dependent kernels on purpose,
--- why they are not simplified unsing definition of '^'?

(7) -> integrate(2^sqrt(3)-e^(sqrt(3)*log(2)),x)

 ┌─┐┌─┐
  log(2)\│3 log(e)   log(2)\│3
   (7)  - x %e + x %e
 Type: Union(Expression(Integer),...)
(8) -> integrate(2^(5/3)-e^((5/3)*log(2)),x)

  5 log(2)log(e)
  ──
 3 3┌─┐2
   (8)  - x %e   + 2 x \│2
 Type: Union(Expression(Integer),...)
(9) -> integrate(2^(1/3)-e^((1/3)*log(2)),x)

  log(2)log(e)
  
3 3┌─┐
   (9)  - x %e + x\│2
 Type: Union(Expression(Integer),...)



Waldek:

You should understand that domain that you propose is quite
unlike domains already present in FriCAS.  Main point is
that there are almost no absolute equalities, most things
are conditional.


Well, you over-evaluate my understanding of FriCAS global design:
I understand that one would simplify only if some conditions are met,
and that many equalities would be undecidable =
larger expressions with hidden identities
but I do not quite see why one could not recycle most of code from the current
Expression Integer, and why a "full tree representation of expressions"
would be mandatory instead of the usual rational function of kernels 
representation.



Waldek:

I have some sympathy towards such domain.  But implementing
it is no small task.  First, it should be correct.  It should
cooperate somewhat with other domains (which is tricky
because it so different from other parts of FriCAS).
And it should be reasonably efficient (naive tree-rewriting
in many cases gives exponential blowup).


"M* on FriCAS" ... the best of the two worlds in a single (open source) CAS... 
appealing indeed.

Thanks for your time
riccardo


[10] https://dlmf.nist.gov/4.8.E2

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this

Re: Re: Re: [fricas-devel] weird primitive

2018-09-12 Thread Riccardo GUIDA

PS:

* Lapsus: in 1) replace "differential algebra" by "differential field" (*-commutative, 
those used by "Risch... alg"). Sorry for the confusion

* I forgot a question:

6) for which domains of a and x is true that x^a = e^{a log(x)} (in FriCAS, I 
mean)? When this is (automatically) used? I will do empirical tests asap I'll 
have time but a design statement is always helpful.

riccardo

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: Re: [fricas-devel] weird primitive

2018-09-11 Thread Riccardo GUIDA

Dear Waldek

thanks for having immediately sent the *summary* of the note I've asked
... now I'm eager to read the forthcoming full note with its details ;)

Well, apart from jokes, I've not re-replied immediately because
I've spent some time digging in old mails of this list trying to grasp
the main ideas of FriCAS present and future design.

Below you'll find some thoughts/questions you might want to comment/answer.

These thoughts concern the user interface for the inverse functions, which is
a topic that periodically returns in the list.

In the past you repeatedly spoke of users with inconsistent wishes, so,
to be more "precise", let me start by setting up some "notation",
reviewing some facts I learned from the list.

I will restrict to log and sqrt for shortness and expose the various ways
such functions might be defined.

All the definitions below (apart maybe SetValuedExpression, I do not know)
should respect the property that
these functions are right-inverses under composition, ie
(sqrt(x))^2 =x exp(log(x))=x for every x in their domain D.

--- PrincipalBranchExpression ---

Let the PrincipalBranchExpression be a domain of analytic, complex valued
functions each defined by its respective ``principal branch'',
ie defined in a cut complex plane,
the cuts being arbitrarily but conventionally agreed to be as detailed
eg by Olver et al. in [2]:

sqrt, log: D -> C  where D:=C -[0,-oo] (I neglect boundaries for simplicity).

For every z1,z2 in D such that z1*z2 in D we have the nice relations
sqrt(z1)*sqrt(z2)=sqrt(z1*z2) and log(z1)+log(z2)=log(z1*z2) (1)

In my knowledge this domain and (1) is well-defined mathematically
but has not a nice algebraic properties adapted to "Risch... algorithm"
and no algorithms to decide if A=0 in full generality. Too Bad.

On the other hand,
a heuristic & arbitrary "simplify" is possible,
based on pattern-matching transformations, eg
implementing a bunch of transformation rules (including (1)) and choosing
the best/shortest result based on some arbitrary expression length function.

This is the domain in which happily & daily work thousand of researchers out 
there,
using Maxima, Sympy and other CAS I do not master or afford.

I guess that (1) is applied automatically by these CAS whenever its hypotheses
may be proven to be satisfied, hence the following replacements are
likely to be exploited.
sqrt(2)*sqrt(3)<~>sqrt(6) and sqrt(1-i)sqrt(1+i)<~>sqrt(2)

--- RealExpression ---

One may define a domain RealExpression of
regular functions on a real subset,
sqrt, log: D -> R  where D:=(0,oo) (I neglect boundaries for simplicity).

At the price of banning some incompatible "highschool relation"
(like (-1)^(1/3)=-1)
I guess that one can consider the functions in  RealExpression as appropriate
restriction of functions in PrincipalBranchExpression,
up to optimizations that exploit reality to improve the speed.
So I do not consider any more this domain.

--- AnyBranchExpression ---

Let AnyBranchExpression be the domain of analytic complex valued
functions, each  well-defined on some arbitrary cut complex plane,
not necessary the ``principal branch''.

In this case a to a function with a single branch point
correspond in general a non countable
infinity of functions, think for instance
sqrt, log: D -> C  where D:=C-[0,oo]*e^{i theta}
with theta in R
and also to the fact that the cut need not to be a straight line.

Now I give some possible approaches to "multi-valued" functions:

--- RiemannSurfaceExpression ---

Let RiemannSurfaceExpression be the domain of meromorphic functions
defined on Riemann surface.

sqrt, log: D -> R  where D "is" {(r,phi): r in R_+ and phi in R }

for every z1,z2 in D
sqrt(z1)*sqrt(z2)=sqrt(z1*z2) and log(z1)+log(z2)=log(z1*z2) (2)

--- SetValuedExpression ---

Let SetValuedExpression be a domain of set-valued functions:

sqrt: C-{0} -> Parts(C),
  x|-> { princbranchsqrt(x),  -princbranchsqrt(x)}.

log: C-{0} -> Parts(C),
 x|-> {princbranchlog(x)+2pi i k, with k in Z}.

I see that there are attempts to construct a mathematical theory of these
set valued functions [3]

IIUC the product in this space is defined by direct product:
f(x)*g(y) = { zf*zg with zf in f(x) and zg in g(y)}.

--- DifferentialField ---

(The following domain is quite new to me and I have much to learn,
so forgive my sloppiness)

Let DifferentialField be some *abstract* field endowed with an additive 
derivative
satisfying Leibniz rule and extending the rational fild Q(x).

This is the natural framework for implementing the "Risch... algorithm"
for finding antiderivatives.

(I do not really know how should define the algebraic "functions" here.
See below.)

In this field one defines

log(x) by D(log(x))=1/x

Actually this does define log(x) "up to a constant", so I do not know if this
log(x) has something to do with the other log(x) defined in the other domains.

As an aside:
Are the elements of DifferentialField naturally isomorphic to
*concrete, numerical* functions?
I 

Re: [fricas-devel] weird primitive

2018-08-03 Thread Riccardo GUIDA

Hi Waldek

I've done some elementary tests to try to understand how FriCAS looks at 
n-rooths and log, but now I am even more confused.

* (1) puzzles me: from your previous answer I have understood that (...)^(1/n) with n>1 
was "mostly" seen by FriCAS as a multivalued and possibly complex algebraic 
number. Is (1) an exception?

* (3) seems to suggest that for positive integer n and positive x x^(1/n) = 
e^(log(x)/n), but this is violated by (7)

* (6) and (8) are consistent, but how is defined x^a with a irrational and 
positive x?


(1) -> (1 = (1)^(1/2))::Boolean

(1)  true
 Type: Boolean
(2) -> (1 = e^(1/2*log(1)))::Boolean

(2)  true
 Type: Boolean
(3) -> (sqrt(1) = e^(1/2*log(1)))::Boolean

(3)  true
 Type: Boolean
(4) -> (1 = (1)^(sqrt(3)))::Boolean

(4)  false
 Type: Boolean
(5) -> (1 = e^(sqrt(3)*log(1)))::Boolean

(5)  true
 Type: Boolean
(6) -> ((1)^(sqrt(3)) = e^(sqrt(3)*log(1)))::Boolean

(6)  false
 Type: Boolean
(7) -> (sqrt(2) = e^(1/2*log(2)))::Boolean

(7)  false
 Type: Boolean
(8) -> (2^sqrt(2) = e^(sqrt(2)*log(2)))::Boolean

(8)  false
 Type: Boolean


I guess that the present status of the code is, as usual, "quite intricated", 
but, if not already done, would it be possible for you to take the time (on the medium 
term) to write a short note or some rule of thumbs to explain to new users how FriCAS 
behaves in view of irrational powers, log, inverse functions, which relations are 
expected to hold, and how integrate and complex integrate behave in view of explicitly 
trascendental numbers, integration variable and external parameters, like a or a^b or 
log(a)?

Furthermore, your view on what should be the ideal target behavior to nicely 
resolve these ambiguities and have a homogeneous interface would surely be a 
relief ...

Best regards
Riccardo

PS Speaking of oddities, to me (11) and (12) should behave in the same way: as 
elements of R->R or or as complex multivalued.

(9) -> sin(0)

(9)  0
 Type: Expression(Integer)
(10) -> sinh(0)

(10)  0
 Type: Expression(Integer)
(11) -> asin(0)

(11)  0
 Type: Expression(Integer)
(12) -> asinh(0)

(12)  asinh(0)

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] question on using .fricas.input, it is not being read by Fricas

2018-08-03 Thread Riccardo GUIDA

No idea what is the problem but I reproduce the issue with Nasser erfc function.

The macro erfc2 is taken into account and works.

ric

(1) -> )system cat /home/guida/.fricas.input
)set output characters default
macro %SIF(e) == unparse(e::InputForm) -- SPAD Input Form
erfc(x) == 1 - erf(x)
macro erfc2(x) == 1 - erf(x)
(1) -> erfc2(1)

   (1)  - erf(1) + 1
Type: Expression(Integer)
(2) -> erfc(1)
   There are no library operations named erfc
  Use HyperDoc Browse or issue
)what op erfc
  to learn if there is any operation containing " erfc " in its
  name.
 
   Cannot find a definition or applicable library operation named erfc

  with argument type(s)
   PositiveInteger
  
  Perhaps you should use "@" to indicate the required return type,

  or "$" to specify which version of the function you need.

(2) -> )display op erfc
   erfc is not a known function. FriCAS will try to list its functions
  which contain erfc in their names. This is the same output you
  would get by issuing
)what operations erfc

   There are no operations containing those patterns

(2) ->

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: Re: [fricas-devel] Using aldor FFI to link mathgl

2018-08-02 Thread Riccardo GUIDA

3) ~ (Naive || impudent)


Funny fix!

Thanks for your clarifications, Kurt.

Riccardo

PS ... and yes I dreamed of replace sman hyperdoc and graphics with Qt (+- 
mathgl)

PS2: could you give a link to the asymptote wrapper?

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] weird primitive

2018-08-02 Thread Riccardo GUIDA

After a rescaling of a and b, the fundamental theorem of calculus holds, uff  :)

But still (4) in my previous email was weird. ric


(1) -> integrand:=1/(x^3*(a*9+b*x)^(1/3))

   1
   (1)  ───
 3 3┌─┐
x  \│b x + 9 a
Type: Expression(Integer)
(2) -> primitive:=integrate(integrand,x)

   (2)
2 2 ┌─┐3┌───┐3┌─┐2   3┌───┐2 3┌─┐
   - 2 b x \│3 log(\│9 a \│b x + 9 a   + \│9 a   \│b x + 9 a  + 9 a)
 +
  2 2 ┌─┐3┌───┐2 3┌─┐
   4 b x \│3 log(\│9 a   \│b x + 9 a  - 9 a)
 +
  ┌─┐3┌───┐2 3┌─┐   ┌─┐
   2 2 2 \│3 \│9 a   \│b x + 9 a  + 9 a\│3
   12 b x atan()
   27 a
 +
   ┌─┐3┌───┐3┌─┐2
   (12 b x - 81 a)\│3 \│9 a \│b x + 9 a
  /
   2 2 ┌─┐3┌───┐
 1458 a x \│3 \│9 a
 Type: Union(Expression(Integer),...)
(3) -> shouldBeZero := D(primitive,x) - integrand

   (3)  0
Type: Expression(Integer)
(4) ->

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] weird primitive

2018-08-02 Thread Riccardo GUIDA

Hi

I was unable to get zero out of (3) , so I tried a trick in (4) (Waldek once 
wrote that integrate simplifies its input), but (4) is now positive for all 
positive  a,b,x ...

I'm confused...
Riccardo



(1) -> integrand:=1/(x^3*(a+b*x/sqrt(3))^(1/3))

3┌─┐
\│3
   (1)  ───
┌─┐
 3 3│┌─┐
x  \│b x\│3  + 3 a
Type: Expression(Integer)
(2) -> primitive:=integrate(integrand,x)

6┌─┐2
\│3
   (2)  - 
┌───┐2
 2 3│6┌─┐3
  2 x  \│b x \│3   + 3 a
 Type: Union(Expression(Integer),...)
(3) -> shouldBeZero := D(primitive,x) - integrand

   (3)
┌───┐2
   3┌─┐6┌─┐3  3┌─┐ 3│6┌─┐3
   (- 3 b x\│3 \│3   - 9 a\│3 )\│b x \│3   + 3 a
 +
 ┌─┐
  6┌─┐5   6┌─┐2 3│┌─┐
   (4 b x \│3   + 9 a \│3  )\│b x\│3  + 3 a
  /
 ┌─┐ ┌───┐2
   4 6┌─┐33 3│┌─┐   3│6┌─┐3
 (3 b x  \│3   + 9 a x )\│b x\│3  + 3 a \│b x \│3   + 3 a
Type: Expression(Integer)
(4) -> shouldBeZero2:=eval(integrate(shouldBeZero,z),z=1)

   (4)
6┌─┐5
  b \│3
   ─
  ┌───┐2
3 52   3 6┌─┐3 2 4   3 2 3│6┌─┐3
   ((9 b x  + (27 a  + 18 a)b x )\│3   + 27 a b x  + 81 a x )\│b x \│3   + 3 a
Type: Expression(Integer)

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Fwd: [fricas-devel] Using aldor FFI to link mathgl

2018-08-02 Thread Riccardo GUIDA

Dear Kurt,

a lot of infos: thanks! BTW A list of all FriCAS non-core packages available on 
internet would be quite helpful to new users, hope Ralf one day will add it to 
the github site


(Kurt)> May certainly compete with mathgl regarding quality ;)

I do not want to enter in graphics-lib faith wars :) -- I must say I do not 
care the lib as far as standard features are available and layout is reasonably 
good.

As  for mathgl: I spent (and I'm spending) some hours in trying to clarify the question 
of angles (theta,phi) in viewport, and I rapidly realized that the C code is -- how to 
say that politely -- "quite intricate" (tons of global variables and includes, 
verbatim code repetitions, unnecessarily repeated computations of geometrical matrices, 
mysterious changes of signs every here and there). For instance, nowadays, each time you 
plot a single 3D  point in view3D you compute two 4x4 matrix products (of which one 
involving the *identity matrix*) to recover the matrices describing the global geometry 
(which is shared among *all* points in a given object). So, to calm my stomach ache, I 
just started to think how I would replace viewmanager and hyperdoc (and maybe socket 
manager) if I was a programmer and to dream of a nice Qt interface (mathgl is self 
contained but Qt friendly).



As  for spad_http: I did not follow your spad_http project in the last months 
and now I'm really impressed by the the fact that you managed to have Jupyter 
working for spad and with some graphics support: bravo!

On the other hand, I must say that there a few things in spad_http that disturb me  
:(  and (for the moment) prevent me from rush and install it in my production 
system: basically my motivations are due to paranoia and ignorance, which may pass 
with time & study of your code. Let me impudently expose them:

1)
I do not like the idea of having a package loader (quicklisp) that installs 
things in my production system (where btw?). IIUC, looking at the *.asd files, 
at each start of the kernel quicklisp is called to load your webSPAD server, 
which depends only on hunchentoot which :depends-on (:chunga, :cl-base64, 
:cl-fad, :cl-ppcre :flexi-streams :md5 :rfc2388 :trivial-backtrace :usocket 
:bordeaux-threads).

In debian I have py2 and py3 packages for all the 3 needed main dependences: 
requests, plotly and Hunchentoot: why should I need quicklisp at all?

Would not be better to keep install of dependencies as an optional command, well 
separated from kernel start & run?

2) (less severe, I guess)

Why do you hardcode the dependence on python 2 ?

On my side I have Jupyter running in python 3 (simpy is stopping support of 
python2 and sagemath working towards supporting py3). I do not know if I can 
safely install debian packages for python2-jupyter and python3-jupyter, so I 
would prefer to patch your code for py3.

Would not be better to stay py2/py3 agnostic and possibly leave the choice to 
the user via configuration or environmental variable?


3) (Naive & impudent)

Why did you introduce a dependence on hunchentoot and drop the original 
python-only Jupyter kernel wrapper or the lisp one? Zero dependencies is better 
than one dependency: are the latter really impossible?

Riccardo

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] Using aldor FFI to link mathgl

2018-08-01 Thread Riccardo GUIDA

Hi

Quite dreamy, I was thinking at the conceptual possibility of writing a spad 
wrapper for the mathgl graphics library [1].

One could make spad-system-calls (systemCommand$MoreSystemCommands) sending 
scripts in mgl language to the mgl interpreter [2] (in the spirit of Bill's 
GnuDraw) or one could try to link the shared objects from the available C 
interface [3].

I've seen Waldek's experimental lapack package [4]. IIUC correctly the equivalent in this 
case would be spad functions calling lisp function wrappers which make 
"alien-calls" to functions in the shared objects from C.

I was wondering, waiting for a FFI for spad, would not be possible/realistic/efficient to 
prepare aldor wrapper functions that directly call the external C functions, then 
"somehow" compile these functions via FriCAS, and finally expose them? I'm 
sorry I'm vague but I never used aldor.

Riccardo

[1] http://mathgl.sourceforge.net/doc_en/MathGL-features.html#MathGL-features
[2] http://mathgl.sourceforge.net/doc_en/Utilities.html#Utilities
http://mathgl.sourceforge.net/doc_en/UDAV.html#UDAV
[3] http://mathgl.sourceforge.net/doc_en/C-interface.html
[4]http://www.math.uni.wroc.pl/~hebisch/fricas/lapack/

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] Buggy looking output form of a Type

2018-08-01 Thread Riccardo GUIDA

... unevaluated concat's in (3). Riccardo

(1) -> gametes:=['AB,'Ab,'aB,'ab]

   (1)  [AB, Ab, aB, ab]
   Type: List(OrderedVariableList([AB,Ab,aB,ab]))
(2) -> segregationRates : List SquareMatrix(4,FRAC INT) := [matrix [ [1, 1/2, 
1/2, 9/20], [1/2, 0, 1/20, 0], [1/2, 1/20, 0, 0], [9/20, 0, 0, 0] ], matrix [ [0, 
1/2, 0, 1/20], [1/2, 1, 9/20, 1/2], [0, 9/20, 0, 0], [1/20, 1/2, 0, 0] ], matrix [ 
[0, 0, 1/2, 1/20], [0, 0, 9/20, 0], [1/2, 9/20, 1, 1/2], [1/20, 0, 1/2, 0] ], 
matrix [ [0, 0, 0, 9/segregationRates : List SquareMatrix(4,FRAC INT) := [matrix [ 
[1, 1/2, 1/2, 9/20], [1/2, 0, 1/20, 0], [1/2, 1/20, 0, 0], [9/20, 0, 0, 0] ], 
matrix [ [0, 1/2, 0, 1/20], [1/2, 1, 9/20, 1/2], [0, 9/20, 0, 0], [1/20, 1/2, 0, 
0] ], matrix [ [0, 0, 1/2, 1/20], [0, 0, 9/20, 0], [1/2, 9/20, 1, 1/2], [1/20, 0, 
1/2, 0] ], matrix [ [0, 0, 0, 9/20], [0, 0, 1/20, 1/2], [0, 1/20, 0, 1/2], [9/20, 
1/2, 1/2, 1] ] ]

   (2)
┌1   19┐  ┌11┐  ┌11┐  ┌ 9┐
│1   ─   ─   ──│  │0   ─   0   ──│  │0   0   ─   ──│  │0   0   0   ──│
│2   2   20│  │2   20│  │2   20│  │20│
│  │  │  │  │  │  │  │
│11│  │19  1 │  │ 9│  │ 1  1 │
│─   0   ──  0 │  │─   1   ──  ─ │  │0   0   ──  0 │  │0   0   ──  ─ │
│2   20│  │2   20  2 │  │20│  │20  2 │
   [│  │, │  │, │  │, │  │]
│11│  │ 9│  │19  1 │  │ 1  1 │
│─   ──  0   0 │  │0   ──  0   0 │  │─   ──  1   ─ │  │0   ──  0   ─ │
│2   20│  │20│  │2   20  2 │  │20  2 │
│  │  │  │  │  │  │  │
│ 9│  │ 1  1 │  │ 1  1 │  │ 9  1   1 │
│──  0   0   0 │  │──  ─   0   0 │  │──  0   ─   0 │  │──  ─   ─   1 │
└20┘  └20  2 ┘  └20  2 ┘  └20  2   2 ┘
Type: List(SquareMatrix(4,Fraction(Integer)))
(3) -> x : ALGSC(DECIMAL, 4, gametes, segregationRates) := convert [3/10, 1/5, 
1/10, 2/5]

   (3)  0.4ab + 0.1aB + 0.2Ab + 0.3AB
Type: 
AlgebraGivenByStructuralConstants(DecimalExpansion,4,[AB,Ab,aB,ab],[[[1,CONCAT(0,.,5),CONCAT(0,.,5),CONCAT(0,.,CONCAT(4,5))],[CONCAT(0,.,5),0,CONCAT(0,.,CONCAT(0,5)),0],[CONCAT(0,.,5),CONCAT(0,.,CONCAT(0,5)),0,0],[CONCAT(0,.,CONCAT(4,5)),0,0,0]],[[0,CONCAT(0,.,5),0,CONCAT(0,.,CONCAT(0,5))],[CONCAT(0,.,5),1,CONCAT(0,.,CONCAT(4,5)),CONCAT(0,.,5)],[0,CONCAT(0,.,CONCAT(4,5)),0,0],[CONCAT(0,.,CONCAT(0,5)),CONCAT(0,.,5),0,0]],[[0,0,CONCAT(0,.,5),CONCAT(0,.,CONCAT(0,5))],[0,0,CONCAT(0,.,CONCAT(4,5)),0],[CONCAT(0,.,5),CONCAT(0,.,CONCAT(4,5)),1,CONCAT(0,.,5)],[CONCAT(0,.,CONCAT(0,5)),0,CONCAT(0,.,5),0]],[[0,0,0,CONCAT(0,.,CONCAT(4,5))],[0,0,CONCAT(0,.,CONCAT(0,5)),CONCAT(0,.,5)],[0,CONCAT(0,.,CONCAT(0,5)),0,CONCAT(0,.,5)],[CONCAT(0,.,CONCAT(4,5)),CONCAT(0,.,5),CONCAT(0,.,5),1]]])

(4) -> z : ALGSC(Fraction Integer, 4, gametes, segregationRates) := convert 
[3/10, 1/5, 1/10, 2/5]

2   1  1   3
   (4)  ─ ab + ── aB + ─ Ab + ── AB
5  10  5  10
Type: 
AlgebraGivenByStructuralConstants(Fraction(Integer),4,[AB,Ab,aB,ab],[[[1,1/2,1/2,9/20],[1/2,0,1/20,0],[1/2,1/20,0,0],[9/20,0,0,0]],[[0,1/2,0,1/20],[1/2,1,9/20,1/2],[0,9/20,0,0],[1/20,1/2,0,0]],[[0,0,1/2,1/20],[0,0,9/20,0],[1/2,9/20,1,1/2],[1/20,0,1/2,0]],[[0,0,0,9/20],[0,0,1/20,1/2],[0,1/20,0,1/2],[9/20,1/2,1/2,1]]])
(5) ->

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] Re: [fricas-devel] BUG: viewpoint$ThreeDimensionalViewport + METAPATCHES

2018-07-28 Thread Riccardo GUIDA

Replies to Waldek's ones (in non-chronological order):




Sorry, not replotting is the feature.  It is impossible to "undo"
spurious replot.  On fast displays spurious replots merely waste
time but on slow ones can create ugly artifacts.  So quality
plotting routines must give user control of replotting.


The main point of the proposal was homogeneity of user interface (UI). 
Presently viewpoint(vp,1,2,3) and rotate(vp,3.14/4.0,3.14/4.0) actually redraw 
so homogeneity of UI and your feature argument would imply to shut-off these 
anti-feature... but mine was a weak suggestion, so it is ok to stay here.

Some unsolicited thoughts "pour parler":

I assume that guaranteeing a user-friendly and as-simple-as-possible UI is 
among FriCAS mandatory targets. I hope for the survival of FriCAS that this is 
the case :)

Viewport UI is not very homogeneous among 2D and 3D: many names, semantics, and 
options are different.

I'm happy to see that there are other packages in development (Scene and 
GnuDraw) but again new UI and, especially for Scene, new concepts and new names 
(sadly violating the full-words naming convention used in Axiom/FriCAS).

Would not be useful to have a few categories that impose a minimal "2D, 3D 
scientific plotting" UI that past, present, and future drawing packages must honor 
(and of course extend if they wish)? This way a user might smoothly move from one package 
to another, and learn the whole details of a package if more functionalities were needed. 
It would encourage developers to test new ways without burdening the users.

Just as a stupid example (with no pretensions, one has to think carefully to 
names, functionalities, options,)

Plot2DShowCategory():Category with
  plot2DFunction
  plot2DCurve
  plot2DPoints
  show2DPlots

Plot2DFormats ==> Union(SVG, Postscript, GnuPlot,)

Plot2DToXCategory( F:Plot2DFormats ):Category
  plot2DFunctionTo
  plot2DCurveTo
  plot2DPointsTo
  show2DPlotsTo

... analog in 3d ...


end of "pour parler".




but ATM I do not see why anybody would want such a routine.


Well, as a benchmark of FriCAS present scientific graphical capabilities I was 
trying to reproduce
https://et.wikipedia.org/wiki/Fail:Gamma_abs_3D.png
with the same parameters:

ViewPoint -> {-2, -2.5, 1}

ie position (x,y,z) of an observer looking toward the object.




Probably first we need to know what those angles really mean.
Saying longitude and latitude avoids real question: what is their
role in display.


You are right. The problem is that src/graph is a jungle...

I'm wondering if the time that it would take to understand all the details of 
src/graph and maintain it is not comparable to that that an experienced C/C++ 
programmer (which excludes me) could take to reconstruct from scratch a minimal 
viewport interface (possibly with more than 9 plots allowed and vector 
graphics...), maybe extracting it form an open source project, ie the Qt based 
https://en.wikipedia.org/wiki/FreeMat

Anyway, at a first sight I would say that a necessary condition is the 
understanding of the omnipresent global macro ROTATE and friends:

void
ROTATE(float xxR[4][4])
{
  xxR[0][0]= -(cosTheta); xxR[0][1]= -(-sinTheta*cosPhi); xxR[0][2]= 
-(sinTheta*sinPhi);  xxR[0][3]= 0.0;
  xxR[1][0]= -(sinTheta); xxR[1][1]= -(cosTheta*cosPhi);  xxR[1][2]= 
-(-cosTheta*sinPhi); xxR[1][3]= 0.0;
  xxR[2][0]= 0.0; xxR[2][1]= -(sinPhi);   xxR[2][2]= -(cosPhi); 
  xxR[2][3]= 0.0;
  xxR[3][0]= 0.0; xxR[3][1]= 0.0; xxR[3][2]= 0.0;   
  xxR[3][3]= -(1.0);
}

https://github.com/fricas/fricas/blob/master/src/graph/view3D/transform3d.c#L90


The problem is that a search gives more definitions of these 
sinTheta/cosTheta/...:
https://github.com/fricas/fricas/search?q=cosTheta&unscoped_q=cosTheta

I guess that the one which interest us are in
https://github.com/fricas/fricas/blob/master/src/graph/view3D/viewport3d.c

more on this later

Riccardo

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] Re: [fricas-devel] eigenvalues

2018-07-27 Thread Riccardo GUIDA

I see, thanks both of you!

@Waldek

What's wrong in trying to "honestly" convert eg Expression(Integer) to a 
Polynomial(Expression(Integer)) or a Fraction (Polynomial(Expression(Integer)))?


1) -> Expression(Integer) has Ring

   (1)  true
Type: Boolean
(2) -> Expression(Integer) has Field

   (2)  true
Type: Boolean
(3) -> Expression(Integer) has PolynomialFactorizationExplicit

   (3)  true
Type: Boolean
(4) -> exi:=%pi+%e^2

  2
   (4)  %e  + %pi
Type: Expression(Integer)

(5) -> exi::Polynomial(Expression(Integer))
 
   Polynomial(Expression(Integer)) is not a valid type.


(5) ->

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] eigenvalues

2018-07-27 Thread Riccardo GUIDA

Hi

does anybody know how to compute the eigenvalues of

(1) -> m:= matrix [[%p, %i *%e],[-%i*%e,%pi^2]]

┌  %p %i %e┐
   (1)  │  │
│2 │
└- %i %e  %pi  ┘

with one of friCAS eigenvalues function?

Thanks in advance, Riccardo

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] zeroOf

2018-07-26 Thread Riccardo GUIDA

Hi

The function zeroOf(p) zeroOf(p,x), with p a polynomial at first sight seems 
more harmful than useful: if there are no radical solution to p=0 it should be 
equivalent to rootOf, which return a generic solution, while if there are 
radicals solution it returns one solution (which one?).

What would be its use case? Is it really wise to leave it exposed?

ric

PS zerosOf is OK.

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] Re: [fricas-devel] )set message bottomup on which function signature is selected?

2018-07-26 Thread Riccardo GUIDA




Ralf wrote:
Obviously, for the result, it wouldn't matter.


Well, maybe obvious for you ... in absence of documentation and without reading 
the code I can imagine at least 3 ways of coercing  x^10 + y -1 to a 
SparseUnivariatePolynomial(Exprression(Integer)):

Calling ? the variable,

(x^10+ y -1)*(?^0)

OR

(?^10) + (y-1)*(?^0)

OR

(?^1)+ (x^10-1)*(?^0)

ric

PS now I know it is the first one...

(6) -> sup

 10
   (6)  y + x   - 1
Type: SparseUnivariatePolynomial(Expression(Integer))
(7) -> coefficients sup

  10
   (7)  [y + x   - 1]
  Type: List(Expression(Integer))

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] [FricasUG] Descriptions of rootOf(suv,x) and rootsOf(suv,x) seem, unhonored

2018-07-26 Thread Riccardo GUIDA

Mainly Ralf ...

From
https://github.com/fricas/fricas/blob/master/src/algebra/algfunc.spad#L14

 rootOf : (SparseUnivariatePolynomial %, Symbol) -> %
   ++ rootOf(p, y) returns y such that \spad{p(y) = 0}.
   ++ The object returned displays as \spad{'y}.



https://github.com/fricas/fricas/blob/master/src/algebra/algfunc.spad#L26

 rootsOf : (SparseUnivariatePolynomial %, Symbol) -> List %
   ++ rootsOf(p, z) returns \spad{[y1, ..., yn]} such that \spad{p(yi) = 0};
   ++ The returned roots contain new symbols \spad{'%z0}, \spad{'%z1} ...;
   ++ Note: the new symbols are bound in the interpreter to the
   ++ respective values.


 From the wordings above I would have expected see %z0, %z1,...
in (4), (5) below...

Don't you?


(1) -> suv:(SparseUnivariatePolynomial(Integer)) := x^10-1

  10
(1)  ?   - 1
 Type: SparseUnivariatePolynomial(Integer)
(2) -> rootOf(suv) -- OK

(2)  %A
 Type: AlgebraicNumber
(3) -> rootsOf(suv) -- OK

(3)
  23 3   2
[%A, %%B1 %A, %%B1 %A, %%B1 %A, (%%B1  - %%B1  + %%B1 - 1)%A, - %A,
  2  3   3   2
 - %%B1 %A, - %%B1 %A, - %%B1 %A, (- %%B1  + %%B1  - %%B1 + 1)%A]
   Type: List(AlgebraicNumber)
(4) -> rootOf(suv,z) -- expected %z ...

(4)  %A
 Type: AlgebraicNumber
(5) -> rootsOf(suv,z) -- expected %z ...

(5)
  23 3   2
[%A, %%B1 %A, %%B1 %A, %%B1 %A, (%%B1  - %%B1  + %%B1 - 1)%A, - %A,
  2  3   3   2
 - %%B1 %A, - %%B1 %A, - %%B1 %A, (- %%B1  + %%B1  - %%B1 + 1)%A]
   Type: List(AlgebraicNumber)

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] )set message bottomup on which function signature is selected?

2018-07-26 Thread Riccardo GUIDA

Hi!

I'm using ')set message bottomup on' to understand coercitions
and the selection of function signatures.
(If you now a better way, please tell me).


Problem: Which function is chosen when more then one choice is admissible?


Eg: In the example below I understand that
[1] and [2] at bottom are admissible signatures for rootsOf
but I do not understand which signature is selected among the two...

?? maybe they are boldly shown by interpreter preference so,
  always the first, ie [1], is used ??



(1) -> pxy:=x^10+y-1 -- poly in two variables

 10
   (1)  y + x   - 1
Type: Polynomial(Integer)
(2) -> )set message bottomup on
(2) -> pxy%ys:=rootsOf(pxy,y)

 Function Selection for rootsOf
  Arguments: (POLY(INT), VARIABLE(y))
   -> no appropriate rootsOf found in Polynomial(Integer)
   -> no appropriate rootsOf found in Variable(y)
   -> no appropriate rootsOf found in Polynomial(Integer)
   -> no appropriate rootsOf found in Variable(y)

 Modemaps from Associated Packages
   no modemaps

 Remaining General Modemaps
   [1] (D,Symbol) -> List(D) from D
if D3 has Join(COMPAR,INTDOM) and D has ACFS(D3)
   [2] (SparseUnivariatePolynomial(D),Symbol) -> List(D) from D if D
has ACF
 
 [1]  signature:   (EXPR(INT), SYMBOL) -> LIST(EXPR(INT))

  implemented: slot (List $)$(Symbol) from EXPR(INT)
 [2]  signature:   (SUP(EXPR(INT)), SYMBOL) -> LIST(EXPR(INT))
  implemented: slot (List $)(SparseUnivariatePolynomial $)(Symbol) from 
EXPR(INT)
 


10
   (2)  [- x   + 1]
  Type: List(Expression(Integer))

Thanks in advance for any hint.
ric

PS Is it possible to have full names and not abbreviations is the above 
messages?

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] Re: Re: Expressing erf as cumulative normal

2018-07-25 Thread Riccardo GUIDA

IIUC there is a misprint in both previous emails: %x in the LHS of the rule 
should be replaced by x as in the RHS. ric

(1) ->  N := operator 'N

   (1)  N
  Type: BasicOperator
(2) -> phirule := rule erf(%x)==2*N(x*sqrt(2))-1 -- BAD

 ┌─┐
   (2)  erf(%x) == 2 N(x\│2 ) - 1
   Type: RewriteRule(Integer,Integer,Expression(Integer))
(3) -> phirule(erf(y))

  ┌─┐
   (3)  2 N(x\│2 ) - 1
Type: Expression(Integer)
(4) -> phirule := rule erf(x)==2*N(x*sqrt(2))-1  -- OK

┌─┐
   (4)  erf(x) == 2 N(x\│2 ) - 1
   Type: RewriteRule(Integer,Integer,Expression(Integer))
(5) -> phirule(erf(y))

  ┌─┐
   (5)  2 N(y\│2 ) - 1
Type: Expression(Integer)

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: Re: [fricas-devel] interesting error in integration

2018-07-24 Thread Riccardo GUIDA

This is old confusion between real and complex.  We create
Complex(Complex(Integer)) and loose.


Naive question: is it not possible/enough to define Complex(R) to be R if R = 
Complex (S)?

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] BUG: viewpoint$ThreeDimensionalViewport + METAPATCHES + SUGGESTED FEATURE

2018-07-19 Thread Riccardo GUIDA

I'm sorry I do not yet have a developer framework setup (virtual machine, git 
...) so you must content yourselves with an untested METAPATCH. ric

PROBLEM:
Crazy behavior of viewpoint function invoked by command line.

BUG:
Evident confusion among radians and degrees in the implementation of viewpoint.

CONVENTIONS:
A viewpoint is a data record inside ThreeDimensionalViewport and has type

V ==> Record( theta : SF, phi : SF, scale : SF, scaleX : SF, scaleY : SF, 
scaleZ : SF, deltaX : SF, deltaY : SF )
https://github.com/fricas/fricas/blob/master/src/algebra/view3D.spad#L39

where, believing to the ++ descriptions, theta is the longitude and phi the 
latitude (Mmmm... physicists use the opposite convention).

Conversion factors degrees to radians are defined by
degrees := pi()$F / 180.0
degreesSF := pi()$SF / 180
https://github.com/fricas/fricas/blob/master/src/algebra/view3D.spad#L401

From the use of the most primitive function rotate one understands that theta 
and phi in V are in radians and Float
https://github.com/fricas/fricas/blob/master/src/algebra/view3D.spad#L801

I do not really understand the difference among the detailed actions
of rotate (line 801) and viewpint (Line 703) because depend on the server.
I *guess* that for given theta, phi they act in the same way, while viewpoint 
(Line 703)  updates all the fields.

It would be nice to double check these conventions but I'm unable to dive in 
ViewportServer$Lisp

METAPATCHES:

1) https://github.com/fricas/fricas/blob/master/src/algebra/view3D.spad#L728

radian/degree mismatch: delete the two occurrences of * degreesSF below:

viewpoint (viewport : %, Theta : F, Phi : F) : Void ==
  viewport.viewpoint.theta := convert(Theta)@SF * degreesSF
  viewport.viewpoint.phi := convert(Phi)@SF * degreesSF

2)
https://github.com/fricas/fricas/blob/master/src/algebra/view3D.spad#L742

2.1: Replace 180.0 by %pi   and 90.0 by %pi/2 below
2.2: The two occurrences of * degrees in rotate must be deleted.
 (Modification 2.2 is superseeded by 4.2 below)

viewpoint (viewport : %, X : F, Y : F, Z : F) : Void ==
  Theta : F
  Phi : F
  if (X = 0$F) and (Y = 0$F) then
Theta := 0$F
if (Z>=0$F) then
  Phi := 0$F
else
  Phi := 180.0
  else
Theta := asin(Y/(R := sqrt(X*X+Y*Y)))
if (Z = 0$F) then
  Phi := 90.0
else
  Phi := atan(Z/R)
rotate(viewport, Theta * degrees, Phi * degrees)

2.3 The corresponding ++ description is wrong
https://github.com/fricas/fricas/blob/master/src/algebra/view3D.spad#L242

The corresponding ++ description is wrong:

viewpoint : (%, F, F, F)-> Void
  ++ viewpoint(v, rotx, roty, rotz) sets the rotation about the x-axis
  ++ to be \spad{rotx} radians, sets the rotation about the y-axis
  ++ to be \spad{roty} radians, and sets the rotation about the z-axis
  ++ to be \spad{rotz} radians, for the viewport v, which is of the
  ++ domain \spadtype{ThreeDimensionalViewport} and displays v with
  ++ the new view position.

If I understand correctly the new description should be

viewpoint : (%, F, F, F)-> Void
  ++ viewpoint(v, x, y, z) sets the viewpoint to cartesian coordinates 
(x,y,z)
  ++ for the viewport v, which is of the
  ++ domain \spadtype{ThreeDimensionalViewport} and displays v with
  ++ the new view position.

3)
You may safely delete the lines 425 to 431 because arcsinTemp and arctanTemp 
are unused.
(Can one call them from other files?)

https://github.com/fricas/fricas/blob/master/src/algebra/view3D.spad#L425

4) SUGGESTED FEATURE: let ALL viewpoint functions to force replotting the 
viewport.

4.1) for the viewpoint at line 720, 724: add at the end the line
viewpoint(viewport,viewport.viewpoint)

4.2) for the viewpoint at line 732 the replotting should be forced, but to be 
homogeneous I would replace

rotate(viewport, Theta, Phi)

by

viewpoint (viewport, Theta, Phi)

4.3) Delete in the ++ strings the statements
++ The new
++ dimensions are not displayed until the function
++ \spadfun{makeViewport3D} is executed again for v.




--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: Re: [fricas-devel] Re: Error detected within library code:, index out

2018-07-19 Thread Riccardo GUIDA

Hi


If using A == Test(SL) with (in package PTEST):


IIUC Test(SL) is a domain: is it legal in SPAD to use a domain in the LHS of a 'with' 
statement? (In Aldor it is not, "the LHS is an optional 'Category'-valued 
expression", see AldorUG sec 7.9)

ric

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] Re: Error detected within library code:, index out of range

2018-07-17 Thread Riccardo GUIDA

Hi Kurt

As FriCAS exercise of the day, I tried to understand the source of your bug but 
the best I can do is a minimal example (vaguely related to the original one) 
and similar errors.

I do not know what mean "non extending category" and "has no ..." compilation 
messages but there were similar ones in the original version.

Hope not increasing the confusion 

ric

   Cumulative Statistics for Constructor SIunits
  Time: 0.00 seconds
 
--non extending category--

.. SIunits of cat
(CATEGORY |package|
 (SIGNATURE |u|
  ((|List|
(|PhysicalUnitSystem|
 (|::| (|construct| '|a| '|b| '|c|) (|List| (|Symbol|   has no
(|PhysicalUnit|)finalizing NRLIB SI
   Processing SIunits for Browser database:
--->-->SIunits(constructor): Not documented
--->-->SIunits((u ((List (PhysicalUnitSystem (:: (construct (QUOTE a) (QUOTE b) 
(QUOTE c)) (List (Symbol: Not documented
--->-->SIunits(): Missing Description
; compiling file "/data/devel/guida/WIP/fricas_learning/SI.NRLIB/SI.lsp" 
(written 17 JUL 2018 04:37:23 PM):

; /data/devel/guida/WIP/fricas_learning/SI.NRLIB/SI.fasl written
; compilation finished in 0:00:00.005

   SIunits is now explicitly exposed in frame frame1
   SIunits will be automatically loaded when needed from
  /data/devel/guida/WIP/fricas_learning/SI.NRLIB/SI

(1) -> )system cat PhysicalUnitsSystem.spad
)abbrev category PUNIT PhysicalUnit
PhysicalUnit() : Category == with
coerce : % -> OutputForm

)abbrev domain PUSYS PhysicalUnitSystem
PhysicalUnitSystem(u:List Symbol) : Exports == Implementation where
Exports == PhysicalUnit with
  baseUnits : () -> List %
Implementation == add
  Rep:=FreeModule(Integer,OrderedVariableList(u))
  baseUnits() == [ 0$Rep]
  coerce(x)== coerce(x)$Rep

)abbrev package SI SIunits
SIunits : Exports == Implementation where

   Exports == with

  u   : () -> List(PhysicalUnitSystem(['a,'b,'c]::List(Symbol)))

   Implementation == PhysicalUnitSystem(['a,'b,'c]::List(Symbol)) add

  u() == baseUnits()$(PhysicalUnitSystem(['a,'b,'c]::List(Symbol)))
(1) -> )show PUSYS
 PhysicalUnitSystem(u: List(Symbol)) is a domain constructor
 Abbreviation for PhysicalUnitSystem is PUSYS
 This constructor is exposed in this frame.
─── Operations 

 baseUnits : () -> List(%) coerce : % -> OutputForm

(1) -> )show SI
 SIunits is a package constructor
 Abbreviation for SIunits is SI
 This constructor is exposed in this frame.
─── Operations 

 
   >> Error detected within library code:

   Improper script count in symbol

(1) -> u()$SI

 LISP output:
()
 
   >> Error detected within library code:

   index out of range

(1) -> )show PUSYS
 PhysicalUnitSystem(u: List(Symbol)) is a domain constructor
 Abbreviation for PhysicalUnitSystem is PUSYS
 This constructor is exposed in this frame.
─── Operations 

 baseUnits : () -> List(%) coerce : % -> OutputForm

(1) ->

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] Re: System error: The value |RandomFloatDistributions| is not of type SEQUENCE

2018-07-13 Thread Riccardo GUIDA

PS:
If I compile my poor function I get "Apparent user error"...


(1) -> )compile RandomGraph.spad
   Compiling FriCAS source code from file
  /data/devel/guida/WIP/fricas_learning/RandomGraph.spad using old
  system compiler.
   RANGRAPH abbreviates package RandomGraph

   initializing NRLIB RANGRAPH for RandomGraph
   compiling into NRLIB RANGRAPH
   compiling exported randomGraph : () -> GraphImage
   processing macro definition nHues ==> 27
   processing macro definition nPoints ==> 100
** comp fails at level 3 with expression: **
error in function randomGraph

(SEQ (MDEF (|nHues|) (NIL) (NIL) 27) (MDEF (|nPoints|) (NIL) (NIL) 100)
 (DEF (|randomX|) (NIL) (NIL) | << |
  (|::| (((|Sel| (|RandomFloatDistributions|) |uniform|) 0 1))
   (|DoubleFloat|))
  | >> |)
 (DEF (|randomY|) (NIL) (NIL)
  (|::| (((|Sel| (|RandomFloatDistributions|) |uniform|) 0 1))
   (|DoubleFloat|)))
 (DEF (|randomPoint|) (NIL) (NIL)
  (((|Sel| |Point| |point|) (|construct| |randomX| |randomY|))
   (|DoubleFloat|)))
 (DEF (|randomPointColor|) (NIL) (NIL)
  (|dark|
   ((|Sel| (|Color|) |color|)
(+ 1 ((|Sel| (|Integer|) |random|) |nHues|)
 (DEF (|randomLineColor|) (NIL) (NIL)
  (|dark|
   ((|Sel| (|Color|) |color|)
(+ 1 ((|Sel| (|Integer|) |random|) |nHues|)
 (DEF (|randomPointSize|) (NIL) (NIL)
  (|::| (+ 1 ((|Sel| (|Integer|) |random|) 30)) (|PositiveInteger|)))
 (|:=| |gim| ((|Sel| (|GraphImage|) |graphImage|)))
 (REPEAT (IN |i| (SEGMENT 1 |nPoints|))
 ((|Sel| (|GraphImage|) |component|) |gim| |randomPoint|
  |randomPointColor| |randomLineColor| |randomPointSize|))
 (|exit| 1 (|return| |gim|)))
** level 3  **
$x:= (:: (((Sel (RandomFloatDistributions) uniform) (Zero) (One))) 
(DoubleFloat))
$m:= NIL
$f:=
|randomX| #) (|nPoints| #) (|nHues| #) (|randomGraph| #) ...)))
 
   >> Apparent user error:

   Cannot coerce (call (ELT $ 15) (call (applyFun (call (ELT $ 14) (call (CONST 
$ 10)) (call (CONST $ 11))
  of mode (DoubleFloat)
  to mode

(1) -> )system cat RandomGraph.spad
)abbrev package RANGRAPH RandomGraph

RandomGraph(): Exports == Implementation where
Exports == with
randomGraph: () -> GraphImage

Implementation == add

randomGraph() ==
nHues ==> 27 -- hardcoded in FriCAS :(
nPoints ==> 100

randomX == ((uniform(0,1)$RandomFloatDistributions)())::DoubleFloat
randomY == ((uniform(0,1)$RandomFloatDistributions)())::DoubleFloat
randomPoint == point([randomX, randomY])$Point DoubleFloat
randomPointColor == dark ( color(1 + (random(nHues)$Integer))$Color 
)
randomLineColor == dark ( color(1 + (random(nHues)$Integer))$Color )
randomPointSize == (1 + random(30)$Integer)::PositiveInteger

gim := graphImage()$GraphImage

for i in 1..nPoints repeat
component(gim, randomPoint, randomPointColor, randomLineColor, 
randomPointSize)$GraphImage

return gim


(1) -> randomX == ((uniform(0,1)$RandomFloatDistributions)())::DoubleFloat --- 
this works
   Type: Void
(2) -> randomX
   Compiling body of rule randomX to compute value of type DoubleFloat

   (2)  0.9642863855364605
Type: DoubleFloat
(3) -> randomX

   (3)  0.03437972397951383
Type: DoubleFloat
(4) ->

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] System error: The value |RandomFloatDistributions| is not of type SEQUENCE

2018-07-13 Thread Riccardo GUIDA

Hi

2 problems:

1) I  can't understand why the function randomGraph defined in 
drawPoints2.input is not find in the same file. Same behavior with 
drawPoints.input which has a more functional style in the use of $.

2) Trying to debugging I've met a system error that might interest the 
developers...

Thanks in advance for any hint!
ric

(1) -> )read drawPoints2.input
randomGraph: () -> GraphImage
 
   Type: Void

randomGraph() ==
nHues ==> 27 -- hardcoded in FriCAS :(
nPoints ==> 100

randomX == ((uniform(0,1)$RandomFloatDistributions)())::DoubleFloat
randomY == ((uniform(0,1)$RandomFloatDistributions)())::DoubleFloat
randomPoint == point([randomX, randomY])$Point DoubleFloat
randomPointColor == dark ( color(1 + (random(nHues)$Integer))$Color )
randomLineColor == dark ( color(1 + (random(nHues)$Integer))$Color )
randomPointSize == (1 + random(30)$Integer)::PositiveInteger

gim := graphImage()$GraphImage

for i in 1..nPoints repeat
component(gim, randomPoint, randomPointColor, randomLineColor, 
randomPointSize)$GraphImage

return gim
 
   Type: Void


gi1:GraphImage := randomGraph()
 
   Compiled code for randomGraph has been cleared.

   Compiling body of rule randomX to compute value of type DoubleFloat
   Compiling body of rule randomY to compute value of type DoubleFloat
   Compiling body of rule randomPoint to compute value of type Point(
  DoubleFloat)
   Compiling body of rule randomPointColor to compute value of type
  Palette
   Compiling body of rule randomLineColor to compute value of type
  Palette
   Compiling body of rule randomPointSize to compute value of type
  PositiveInteger
   Compiling function randomGraph with type () -> GraphImage
   There are no library operations named randomGraph
  Use HyperDoc Browse or issue
)what op randomGraph
  to learn if there is any operation containing " randomGraph " in
  its name.
 
   Cannot find a no-argument definition or library operation named

  randomGraph .

(3) -> )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 SF :
   This is a system-defined macro.
   macro SF () == DoubleFloat()
Properties of gi1 :
   Declared type or mode:   GraphImage
Properties of randomGraph :
   Declared type or mode:   (() -> GraphImage)
   This is an interpreter function.
   This depends on the following functions or rules:
  $elt GraphImage component randomPoint randomPointColor randomLineColor 
randomPointSize graphImage PositiveInteger random Integer color Color dark 
randomY randomX point DoubleFloat Point uniform RandomFloatDistributions 
/throwAway
 
   >> System error:

   The value |RandomFloatDistributions| is not of type SEQUENCE.

(3) -> )clear completely
   All user variables and function definitions have been cleared.
   All )browse facility databases have been cleared.
   Internally cached functions and constructors have been cleared.
   )clear completely is finished.
(1) -> )read drawPoints.input
randomGraph: () -> GraphImage
 
   Type: Void

randomGraph() ==
nHues ==> 27 -- hardcoded in FriCAS :(
nPoints ==> 100

randomX == ((uniform$RandomFloatDistributions)(0,1)())::DoubleFloat
randomY == ((uniform$RandomFloatDistributions)(0,1)())::DoubleFloat
randomPoint == (point$Point DoubleFloat)([randomX, randomY])
randomPointColor == dark ((color$Color)(1 + (random$Integer)(nHues)))
randomLineColor == dark ((color$Color)(1 + (random$Integer)(nHues)))
randomPointSize == (1 + (random$Integer)(30))::PositiveInteger

gim := (graphImage$GraphImage)()

for i in 1..nPoints repeat
(component$GraphImage)(gim, randomPoint, randomPointColor, 
randomLineColor, randomPointSize)

return gim
 
   Type: Void


gi1:GraphImage := randomGraph()
 
   Compiled code for randomGraph has been cleared.

   Compiling body of rule randomX to compute value of type DoubleFloat
   Compiling body of rule randomY to compute value of type DoubleFloat
   Compiling body of rule randomPoint to compute value of type Point(
  DoubleFloat)
   Compiling body of rule randomPointColor to compu

[fricas-devel] [FriCASUG +API] metapatches on 2D graphs

2018-07-12 Thread Riccardo GUIDA

Mainly for Ralf ...

--
https://github.com/fricas/fricas/blob/master/src/doc/htex/ug07.htex#L154
REPLACE:
\spadgraph{draw(sin(tan(x)) - tan(sin(x)),x = 10..16)}
BY:
\spadgraph{draw(sin(tan(x)) - tan(sin(x)),x = 10..16,title=="A title here")}
MOTIVATION:
A title was announced the line before.

---
https://github.com/fricas/fricas/blob/master/src/doc/htex/ug07.htex#L222
REPLACE:
\psXtc{
The title may be an arbitrary string and is an
optional argument to the \spadfun{draw} command.
}{
\spadgraph{draw(curve(cos(t), sin(t)), t = 0..2*\%pi)}
}{
BY:
\psXtc{
Note that \Language{} provides a default title based on
the first function specified in \spadfun{curve}.
The title may be an arbitrary string and is an
optional argument to the \spadfun{draw} command.
}{
\spadgraph{draw(curve(cos(t), sin(t)), t = 0..2*\%pi, title=="A title here" )}
}{


https://github.com/fricas/fricas/blob/master/src/doc/htex/ug07.htex#L263
DELETE:
Also note that \Language{} provides a default title based on
the first function specified in \spadfun{curve}.

MOTIVATION:
Sentence anticipated where it is relevant.
A title was announced the line before the first patch.


https://github.com/fricas/fricas/blob/master/src/doc/htex/ug07.htex#L276

MOTIVATION:
In 276 -- 293 \spad{p(x,y)} is used instead of a mathematical polynomial p(x,y).
I would eliminate \spad and use the command appropriate for maths.


In 296--310, The mathematical notation p(x,y) of a polynomial expression
is misleading in a command reference, and leads to think to a function p is 
needed.
I suggest to replace p(x,y) by p, and explain that it is an expression
of type Polynomial with variables x,y.


https://github.com/fricas/fricas/blob/master/src/doc/htex/ug07.htex#L392
https://github.com/fricas/fricas/blob/master/src/doc/htex/ug07.htex#L406
https://github.com/fricas/fricas/blob/master/src/doc/htex/ug07.htex#L445
https://github.com/fricas/fricas/blob/master/src/doc/htex/ug07.htex#L458
https://github.com/fricas/fricas/blob/master/src/doc/htex/ug07.htex#L468

TODO:
Patch draw to show units when unit=... is given

MOTIVATION:
unit=-=... is used but nothing is shown in the image.

---

https://github.com/fricas/fricas/blob/master/src/doc/htex/ug07.htex#L400

REPLACE:
Option {\tt clip} with a range sets point clipping of a graph within the
BY:
Option {\tt clip} with a range shows only points within the

MOTIVATION: 'to set point clipping' seems quite technical, plain words are
better.

---
https://github.com/fricas/fricas/blob/master/src/algebra/view2D.spad#L10
REPLACE:
++ Description: TwoDimensionalGraph creates virtual two dimensional graphs
BY:
++ Description: GraphImage creates virtual two dimensional graphs
MOTIVATION:
IIUC TwoDimensionalGraph does not exist (old name of GraphImage?)
https://github.com/search?q=TwoDimensionalGraph+repo%3Africas%2Ffricas+extension%3Aspad&type=Code&ref=advsearch

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: Re : [fricas-devel] [BUG]: draw option unit == [a,b] ignored

2018-07-12 Thread Riccardo GUIDA

Ralf

1)
Many graphs in chapter seven FriCAS UG do NOT correspond to what announced in 
the text (I was preparing a list of patches but you anticipated me).

In 2D graphs this is due to a missing 'title=...' in the invoked command draw  
and also due the fact that 'unit=...'  shows nothing because the system default 
is do not show units. This way one has to manually switch them via the control 
panel, as Johannes remarked, or by invoking units.

This behavior is highly user-unfriendly: if a user takes the time to write 
unit=... in the command, that likely means that s/he wants to see them 
(immediately!)

So, to me, the simplest & user-friendliest solution would be a patch that adds 
a line that shows the unit whenever the unit=...  option is there (maybe by calling 
units, but I do not know if the viewport is available at that level). Right now I'm 
unable to suggest more...

2)
Speaking of the wide family of draw functions, I have the impression that there 
is some interpreter black magics involved in how options are dealt with.

The problem is that one needs functions with a variable number of formal 
parameters (the options).

In the API I see signatures involving 'List DrawOption' :

draw: (Ex, SegmentBinding Float, List DrawOption) -> TwoDimensionalViewport

draw(f(x), x = a..b, [ title="bim", units=[1.0..2.0,1.0..2.0] ])

but in interpreter you invoke them WITHOUT a list of options i.e.

draw(f(x), x = a..b, title="bim", units=[1.0..2.0,1.0..2.0])

This conflicts with the API, and I guess plain SPAD

... I hate exceptions!

I see that there is some hardcoded code in the interpreter dealing with draw
src/interp/i-funsel.boot#L300  [1]
but I do not really understand if the aforementioned magic happens here. Hope 
that Waldek will pass and prune the un-necessary here...


3)
Speaking of user-unfriendliness of draw functions, I would like to emphasize 
that draw for algebraic curves draw(f(x, y) = g(x, y), x, y, l) [2] introduces 
an exception to the usual syntax for ranges, obliging the user to use an adhoc 
option 'range':

draw(x^2+y^2 =1, x, y, range==[0..1,0..1])

instead of the usual syntax

draw(x^2+y^2 =1, x = 0..1, y=0..1)

... I hate exceptions!


ric

[1] https://github.com/fricas/fricas/blob/master/src/interp/i-funsel.boot#L300
[2] 
https://github.com/hemmecke/fricas/blob/master-hemmecke/src/algebra/draw.spad#L962

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: Re: [fricas-devel] [BUG]: draw option unit == [a,b] ignored

2018-07-11 Thread Riccardo GUIDA

[Grabmeier]> you must make sure that in the control panel you have "units on" 
and you
[Grabmeier]> possibly have to scale the size of the window in order to have 
space for
[Grabmeier]> tick labelling.


Aha, thanks Johannes!!! Units was off: the following works

(2) -> vp := draw(sin(11*x),x = 0..2*%pi,title == "Large and unit", 
unit==[0.2,0.2])
   Compiling function %D with type DoubleFloat -> DoubleFloat
   Graph data being transmitted to the viewport manager...
   FriCAS2D data being transmitted to the viewport manager...

   (2)  TwoDimensionalViewport: "Large and unit"
 Type: TwoDimensionalViewport
(3) -> units(vp,1,"on")
   Type: Void

So this is not a bug, just a missing feature: I would have expected that setting 
unit==... in draw would automatically trigger units(...,"on").

Cheers,
riccardo

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] [BUG]: draw option unit == [a,b] ignored

2018-07-11 Thread Riccardo GUIDA

Hi,

IIC the user guide the draw option unit==[0.2,0.2] should add ticks to the axes 
x and y, but I cannot see anything.

Try eg:

draw(sin(11*x),x = 0..2*%pi,toScale == true,title == "Drawn to scale")
draw(sin(11*x),x = 0..2*%pi,toScale == true,title == "Drawn to scale and unit", 
unit==[0.2,0.2])
draw(sin(11*x),x = 0..2*%pi,toScale == true,title == "Drawn to scale and unit", 
unit==[0.5,0.5])
draw(sin(11*x),x = 0..2*%pi,title == "Large and unit", unit==[0.2,0.2])
draw(sin(11*x),x = 0..2*%pi,title == "Large and unit", unit==[0.5,0.5])

Am I missing something important?
ric

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] Intepreter: type declaration ignored in == AND: BOOT::|sayFunctionDeps| is undefined.

2018-07-11 Thread Riccardo GUIDA

Hi, thanks for the feedback.


[Bill]> Although this terminology is used in a few places,


"... a few places"? Well, I would say "almost everywhere": Jenks Sutor vol 0, 
hyperdoc, fricasUG, mathaction ...


[Bill]>I do not think it
[Bill]> is correct to call == delayed assignment. Rather it only represents
[Bill]> kind of function definition via matching (which granted, does involve
[Bill]> some form of delayed assignment). More specifically in the interpreter
[Bill]> == defines a "rule". In the case of ==, : is an operator like any
[Bill]> other. E.g.


I see your point of view. This sheds more light also on T3(f(x)) == ... in [1]

A mystery is that according to the interpreter messages there are "interpreter functions" 
and "interpreter rules", so one might wonder if there are different, undocumented 
syntaxes and semantics:

(1) ->  z == 1
   Type: Void
(2) -> x + y == 5 -x + 10 *y
   Type: Void
(3) -> )display properties + z
Properties of + :
   This is an interpreter function.
   Definition:   + (x, y) == 5 - x + 10 y
Properties of z :
   This is an interpreter rule.



... I'm starting to believe that the only way for a user to grasp how the 
interpreter works in many cases is to (learn boot & lisp and) read the source 
files ... quite time consuming task ... sigh ...



I'm also disturbed by the fact that a (fool) user can happily hide a library 
operation like +. I would have preferred to be obliged to write something like

IAmNotInsaneAndIReallyWantToRedefine(_+)

before being able to redefine.






[ric]> (2) -> y:Integer == 1

[Oldk1331]> This is a strange way to input in FriCAS, it actually defined a 
rule for ':'

Well, I had the (unwise) idea of approaching FriCAS by first reading the whole 
AldorUG, so my test was Aldor-inspired [1]



regards
riccardo

[1] https://www.mail-archive.com/fricas-devel@googlegroups.com/msg12354.html
[2] http://www.aldor.org/docs/HTML/chap5.html#3

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] Intepreter: type declaration ignored in == AND: BOOT::|sayFunctionDeps| is undefined.

2018-07-10 Thread Riccardo GUIDA

Hi

Command line interpreter: I realize that type declaration is ignored in delayed 
assignment == even for variables (see [1] for a similar behavior for functions)

Same behavior from .input file.

AND

At the same occasion I get a weird system error in )display properties, which 
might interest Waldek...

cheers,
riccardo

(1) -> x:Integer := 1

   (1)  1
Type: Integer
(2) -> y:Integer == 1
   Type: Void
(3) -> z == 1
   Type: Void
(4) -> [x,y,z]
   Compiling body of rule z to compute value of type PositiveInteger

   (4)  [1, y, 1]
  Type: List(Polynomial(Integer))
(5) -> )display properties x y z
Properties of x :
   Declared type or mode:   Integer
   Value (has type Integer):  1
Properties of y :
   none
Properties of z :
   This is an interpreter rule.
 
   >> System error:

   The function BOOT::|sayFunctionDeps| is undefined.



(5) -> )read test.input
)clear completely
 
   All user variables and function definitions have been cleared.

   All )browse facility databases have been cleared.
   Internally cached functions and constructors have been cleared.
   )clear completely is finished.
x2:Integer := 1
 


   (1)  1
Type: Integer
y2:Integer == 1
 
   Type: Void

z2 == 1
 
   Type: Void

[x2,y2,z2]
 
   Compiling body of rule z2 to compute value of type PositiveInteger


   (4)  [1, y2, 1]
  Type: List(Polynomial(Integer))
)display properties x2 y2 z2
 
Properties of x2 :

   Declared type or mode:   Integer
   Value (has type Integer):  1
Properties of y2 :
   none
Properties of z2 :
   This is an interpreter rule.
 
   >> System error:

   The function BOOT::|sayFunctionDeps| is undefined.




[1]
https://www.mail-archive.com/fricas-devel@googlegroups.com/msg12308.html

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] FricasUG metapatch: palindromes and eirule

2018-07-09 Thread Riccardo GUIDA

Mainly for Ralf...

--
https://github.com/fricas/fricas/blob/master/src/doc/htex/ug06.htex#L2410
REPLACE:
(s.i = s.j) and palAux?(s,i+1,i-1)
BY:
(s.i = s.j) and palAux?(s,i+1,j-1)
MOTIVATION:
IIUC, presently the function palAux? declare palindromes aggregates having 
equal first and last element.
This results in an wrong stream FricasUG sec 6.20, pag 218, (9)
The nine-th term
11^2 = 1234567900987654321
is NOT palindrome and false would have been expected.

--
https://github.com/fricas/fricas/blob/master/src/doc/htex/ug06.htex#L2735
REPLACE:
\spadcommand{eirule integral(sin u + exp u/u, u) \free{eirule}}
BY eg:
\spadcommand{eirule integral((sin u + exp u)/u, u) \free{eirule}}
MOTIVATION:
The current example does not test the ?y pattern in FricasUG sec 6.21, pag 223, 
(17) as anticipated in the text.

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] FricasUG metapatch: 7 and )set functions cache all all

2018-07-07 Thread Riccardo GUIDA

Mainly for Ralf...

--
https://github.com/fricas/fricas/blob/master/src/doc/htex/ug06.htex#L894
REPLACE:
What is the value for \spad{n = 7}?
BY:
What is the value for \spad{n = 3}?
MOTIVATION:
The line below contains facto(3)

--
https://github.com/fricas/fricas/blob/master/src/doc/htex/ug06.htex#L1218
REPLACE:
Use no list of names or ``all'' when you want to define the default
BY:
Use no list of names when you want to define the default
MOTIVATION:
IIUC, the original sentence suggests that the syntax is
)set functions cache (0||all)  [f...|all]
while a test shows that the syntax is
)set functions cache (0||all)  [f...]
Eg: the trailing ``all`` is interpreted as a function.
(1) -> )set functions cache 0 all
Caching for function all is turned off
(1) -> )set functions cache 3 all
function all will cache the last 3 values.
(1) -> )set functions cache all all
function all will cache all values.
(1) -> )set functions cache all f
function f will cache all values.

If I'm missing another more meaningful interpretation, I would say
that the statement should be rewritten to be unambiguous.
--

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] interpreter (command line): weird syntax allowed for function of function

2018-07-06 Thread Riccardo GUIDA

Hi,

T,T2,T3 below are meant to implement the same map that takes a function x+->f(x) and 
returns a function  x+->x+f(x), both functions of signature Integer->Integer.

I understand the syntax of the assignments to T, T2 below, but I would have been happier 
to get back a "syntax error" after the definition of T3 (6).

Any clue of how "thinks" the interpreter when dealing with (6)?  It looks like 
if it interpreted 'f(x)' for 'f'... Some (undocumented) interpreter language feature ?

Thanks for any clue
riccardo



(1) -> T: (Integer -> Integer) -> (Integer ->Integer)
   Type: Void
(2) -> T2: (Integer -> Integer) -> (Integer ->Integer)
   Type: Void
(3) -> T3: (Integer -> Integer) -> (Integer ->Integer)
   Type: Void
(4) -> T(f) == (x+->f(x)+x)
   Type: Void
(5) -> (T2(f))(x) == x+f(x)
   Type: Void
(6) -> T3(f(x))==x+f(x)
   Type: Void
(7) -> (T(x+->x^3))(3)
   Compiling function T with type (Integer -> Integer) -> (Integer ->
  Integer)

   (7)  30
Type: PositiveInteger
(8) -> (T2(x+->x^3))(3)
   Compiling function T2 with type (Integer -> Integer) -> (Integer ->
  Integer)

   (8)  30
Type: PositiveInteger
(9) -> (T3(x+->x^3))(3)
   Compiling function T3 with type (Integer -> Integer) -> (Integer ->
  Integer)

   (9)  30
Type: PositiveInteger
(10) -> )display properties T T2 T3
Properties of T :
   Declared type or mode:   ((Integer -> Integer) -> (Integer -> Integer))
   This is an interpreter function.
   This depends on the following function or rule: x
   Definition:   T f == x +-> f(x) + x
   Compiled function type: (Integer -> Integer) -> (Integer -> Integer)
Properties of T2 :
   Declared type or mode:   ((Integer -> Integer) -> (Integer -> Integer))
   This is an interpreter function.
   This depends on the following function or rule: x
   Definition:   T2 f == x +-> x + f(x)
   Compiled function type: (Integer -> Integer) -> (Integer -> Integer)
Properties of T3 :
   Declared type or mode:   ((Integer -> Integer) -> (Integer -> Integer))
   This is an interpreter function.
   This depends on the following function or rule: x
   Definition:   T3 f == x +-> x + f(x)
   Compiled function type: (Integer -> Integer) -> (Integer -> Integer)

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: Re: [fricas-devel] interpreter (command line): syntax of "rule"

2018-07-05 Thread Riccardo GUIDA

The escape symbel _ is necessary in order to defeat the magic.


Great, many thanks Bill! I saw the API for RewriteRule and I was willing to try 
these functions, but I was unable to defeat interpreter's magics.

riccardo


--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] interpreter (command line): syntax of "rule"

2018-07-05 Thread Riccardo GUIDA

Hi

I do not understand how the syntax

rule sin(x) == x  -- see (1) below

is accommodated to fit in the signature
(EXPR(INT), EXPR(INT)) -> RULE(INT,INT,EXPR(INT))
see fricas message below

In other words: in (1) I do not see a call to a function "rule" of two 
parameters, rule(f,g): what's happening? Is this an interpreter (command line) language 
construct that has nothing to do with standard function call of type  rule(f,g)?

Can one rewrite (1) as an equivalent function call rule(f,g) for some f,g?

Thanks in advance for any hint,
Riccardo


(1) -> rule sin(x) == x -- unwise rule

 Function Selection for sin
  Arguments: VARIABLE(x)
   -> no appropriate sin found in Variable(x)
   -> no appropriate sin found in Symbol
   -> no appropriate sin found in Variable(x)
   -> no appropriate sin found in Symbol

 Modemaps from Associated Packages
   no modemaps

 Remaining General Modemaps
   [1] D -> D from D if D has TRIGCAT
 
 [1]  signature:   EXPR(INT) -> EXPR(INT)

  implemented: slot $$ from EXPR(INT)
 


 Function Selection for rule
  Arguments: (EXPR(INT), VARIABLE(x))
   -> no appropriate rule found in Expression(Integer)
   -> no appropriate rule found in Variable(x)
   -> no appropriate rule found in Expression(Integer)
   -> no appropriate rule found in Variable(x)

 Modemaps from Associated Packages
   no modemaps

 Remaining General Modemaps
   [1] (D1,D1) -> RewriteRule(D2,D3,D1) from RewriteRule(D2,D3,D1)
if D2 has SETCAT and D3 has Join(RING,PATMAB(D2),COMPAR,
KONVERT(PATTERN(D2))) and D1 has Join(FS(D3),PATMAB(D2),
KONVERT(PATTERN(D2)))
 
 [1]  signature:   (EXPR(INT), EXPR(INT)) -> RULE(INT,INT,EXPR(INT))

  implemented: slot $(Expression (Integer))(Expression (Integer)) from 
RULE(INT,INT,EXPR(INT))
 


   (1)  sin(x) == x
   Type: RewriteRule(Integer,Integer,Expression(Integer))
(2) ->

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] Bugs in TransSolvePackage

2018-07-02 Thread Riccardo GUIDA

PS


(6) -> solve(sinh(z)/cosh(z)=0,z) -- ???  AWFUL KO



  (6)  [z = 0, z = log(- 1)]
   Type: List(Equation(Expression(Integer)))


I mean, if log it is defined also on the axis |z| e^{i pi } than z=i pi should 
be ok, but what is bad is that one finds 0,1,2 solutions according to the 
representation of the question.

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] Fricas on SPAD vs Fricas on Aldor?

2018-07-02 Thread Riccardo GUIDA

Dear Waldek

Could you comment on my (naive) thoughts & questions below?
I use quotes for admittedly-unprecise terms.

I'm pretty sure you've talked about this in the last decade, but the 
information is quite spread around in the list.

Thoughts:

* The Aldor compiler is an improved version of the Spad compiler, written by one of its 
authors. So, as a non-expert, I would blindly tend to say that Aldor compiler is 
"better" than Spad compiler. At least it has written documentation and, I 
guess, it should produce faster compiled code (eg by compiling via the C compiler not the 
lisp one).

*  Spad syntax is, say, "90% equal" to Aldor, so moving the .spad files in 
algebra to .as files should not be impossible.

* I guess the really "hard" problem is "porting" the interpreter to work on the 
top of Aldor, maybe using its -gloop shell.

* On this list, I've never heard mentioning this "port to Aldor" even as a long 
term/dreamy  project, while I've heard hypothetical mentions on  rewriting the current fricas 
interpreter, which should also be "hard".

So my questions:

* would "porting" the interpreter on the top of aldor be much more difficult & 
unrealistic than rewriting the current fricas interpreter?

* Which solution do you prefer, and, more important, could you somehow explain 
why?

Thanks for your answer(s), and sorry for my impudence!
riccardo



 


--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: Re: Re: Re: [fricas-devel] unique Value of Void

2018-07-02 Thread Riccardo GUIDA

You seem to use different terminology.  Spad is language of .spad files.
They are intended for non-interactive use -- basicaly enhancements to
FriCAS library.  Spad is different than language of .input files.
.input files are intended for interactive use.  Now, with "interactive
language" there is some confusion, as functions are normally compiled
while command line gets special treatment.


Dear Waldek,

to explain: my answer relied on the following hypotheses

* SPAD is the language of .spad files, invoked by )compile
* the interpreter =
  interprets a subset of SPAD language (eg no definitions of domain) on command 
line and via )read .input files
+ heuristics guesses & coercitions on types
+ SPAD compilation of functions in case of complete type resolutions


... so naively I thought that, if the interpreter is so unpredictable on types, 
maybe it was more pedagogical to present things as subsets of SPAD, which is 
well defined, but now I realize that maybe the examples given maybe do not 
compile in SPAD, even if embedded in functions of user-defined packages, I do 
not know, I'm learning using the command line.


I guess I need some official glossary, could you please enlighten me?

* How should be called "The language of .input files?"

* Is "The language of .input files" the same thing as "the language of command 
line"?, and if not how is called the latter?

* Is the compiler invoked by the interpreter when compiling functions the same 
compiler (same language) as the SPAD compiler invoked by )compile ?

* Which language is meant by 'The FriCAS language' and 'The FriCAS interactive 
language'?

A post on a related question will follow.

riccardo










--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] Bugs in TransSolvePackage

2018-07-02 Thread Riccardo GUIDA

This is an improved revival of a 2007 bug [1] which seems still in good health


(1) -> solve(tan(z)=0,z)   -- OK

   (1)  [z = 0]
Type: List(Equation(Expression(Integer)))
(2) -> solve(sin(z)/cos(z)=0,z) -- OK

   (2)  [z = 0]
Type: List(Equation(Expression(Integer)))
(3) -> solve(cot(z)=0,z) -- OK

 %pi
   (3)  [z = ───]
  2
Type: List(Equation(Expression(Integer)))
(4) -> solve(cos(z)/sin(z)=0,z)-- ???

   (4)  []
Type: List(Equation(Expression(Integer)))
(5) -> solve(tanh(z)=0,z)  -- ???  I'm wondering why fricas does not know 
that atanh(0) = 0

   (5)  [z = atanh(0)]
Type: List(Equation(Expression(Integer)))
(6) -> solve(sinh(z)/cosh(z)=0,z) -- ???  AWFUL KO

   (6)  [z = 0, z = log(- 1)]
Type: List(Equation(Expression(Integer)))
(7) -> solve(coth(z)=0,z)-- ? Error???
 
   >> Error detected within library code:

   Invalid argument

(7) -> coth(z)=0

   (7)  coth(z) = 0
  Type: Equation(Expression(Integer))
(8) ->







PS

The semantics of [] is not really crystal-clear...

(8) -> solve(cos(z)/sin(z)=cot(z),z)

   (8)  []
Type: List(Equation(Expression(Integer)))
(9) -> solve(sin(z)/cos(z)=tan(z),z)

   (9)  []
Type: List(Equation(Expression(Integer)))


It seems to me that the natural output for general solvers should be a set, see 
[2].


[1] http://axiom-wiki.newsynthesis.org/104BranchCutsDiffer?root=IssueTracker
[2] http://docs.sympy.org/latest/modules/solvers/solveset.html

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] [BUG] scoping problems in interpreter (nothing really new)

2018-07-02 Thread Riccardo GUIDA

Hi,

I'm now aware of the status of the interpreter in fricas: this is just for the 
record (fricas 1.3.4).

fricas 1.3.4: interpreter bug  on scopes similar the one reported in
https://www.mail-archive.com/fricas-devel@googlegroups.com/msg12273.html

(1) -> i:=1; for i in 1..3 repeat output(i^2); i
   1
   4
   9
 
   i is declared as being in PositiveInteger but has not been given a

  value.

(1) -> i:=1; (for i in 1..3 repeat output(i^2)); i
   1
   4
   9
 
   i is declared as being in PositiveInteger but has not been given a

  value.

(1) -> i

   (1)  1
Type: PositiveInteger

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: Re: Re: [fricas-devel] unique Value of Void

2018-07-01 Thread Riccardo GUIDA

@Bill:


If the else clause is missing but the if condition is false then the
value of the if-then expression is the unique value of Void. 


+1


I think an important though somewhat less technical addition to the
user guide concerning the meaning and use of the Void and Exit domains
would indeed be quite useful. 


+1

(Maybe adding also something on None if this Type will still be around. 
Somewhere near section 2.6 might be a good place.)

@ Waldek


The command line is not representative of FriCAS language.


OK, crystal clear.

The pedagogical problem is that, maybe not to scare the reader, the FricasUG is somehow 
vague on the differences among interpreter and compiler. For instance note that the 
chapter 5 (which raised my questions) is titled  "Introduction to the FriCAS 
Interactive Language", while it is presently more like an (incomplete) SPAD 
reference.

riccardo

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: Re: [fricas-devel] unique Value of Void

2018-06-29 Thread Riccardo GUIDA

Hi,

Thanks for your clarifications Bill.


Just to say that my original question to Ralf was a much more low level quest 
for clarifications in the user guide:

1) A user reads:

section 5.3 pag 149
"An if-then-else expression always returns a value. If the else clause is missing 
then the entire expression returns the unique value of Void. If both clauses are present, 
the type of the value returned by if is obtained by resolving the types of the values of 
the two clauses. See Section 2.10 on page 109 for more information." (Check also the 
boxed text above this statement.)

2) The user does not really understand the statement and, if he is motivated, 
tries to experiment:

(1) -> if 1>2 then 1   -- here he expects Void
   Type: Void
(2) -> if 2>1 then 1  -- here he expects Void but gets PositiveInteger

   (2)  1
Type: PositiveInteger
(3) -> if 2>1 then 1 else [1,2,3] -- here he expects common supertype, but 
which one?

   (3)  1
Type: PositiveInteger
(4) -> if 1>2 then 1 else [1,2,3] --  here he expects common supertype, which  
one?

   (4)  [1, 2, 3]
  Type: List(PositiveInteger)

3) The user is puzzled because

* in (2) below he gets Type: Positive Integer not Type: Void
* in (3) and (4) below he sees 2 different types and not a "common supertype"



From your explanations now I understand that there are a lot of hidden coercitions in the game and 
that what is said in the user guide does not contradict the experiments. But I feel it would be 
helpful to have some clarifying information in the user guide not after page 149. Writing "the 
unique value of Void" is not of help because what is not evident is the fact that "every 
value can be coerced to Void". I realize now that this is said at pag 763, sec 9.87 (in my 
version of FricasUG), but at least a footnote in page 149 would have helped.

ric

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] Re: [FricasUG] FIXME: sec 2.5.2 pag 96 osolete description & Feature suggestion for Union-s

2018-06-28 Thread Riccardo GUIDA

Sorry, I retract my feature suggestion because Union with selectors are there 
also in Aldor and with more features that make such selectors more meaningful: 
i.e. assignment via selector, like u := [num == 3].
RiCCardo

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] [FricasUG] FIXME: sec 2.5.2 pag 96 osolete description & Feature suggestion for Union-s

2018-06-28 Thread Riccardo GUIDA

Hi,

if this is not the correct place for sending FricasUG fix requirements, please 
excuse me and let me now.

RiCCardo

[FricasUG] FIXME: sec 2.5.2 "Union-s with selectors" pag 96
"Note that case uses the selector name as its right-hand argument. If you 
accidentally use the branch
type on the right-hand side of case, false will be returned. Now it returns 
error."


(1) -> U := Union(i:Integer, s:String)

   (1)  Union(i: Integer,s: String)
   Type: Type
(2) -> x:U := "bam"

   (2)  "bam"
   Type: Union(s: String,...)
(3) -> x case Integer
 
   >> Error detected within library code:

   upcase: bad Union form

(3) -> x case String
 
   >> Error detected within library code:

   upcase: bad Union form

(3) -> x case i

   (3)  false
Type: Boolean
(4) -> x case s

   (4)  true

The statements above prove that the fricasUG must be fixed.


=== Feature suggestion for Union-s ===

I must say that I would find more natural (and maybe it would have simpler code)
to have the predicates
x case Integer
x case String
as for non-selector Union-s and to use selectors only to get the values
x.i
x.s
with "failed" instead of a coerce error when the inappropriate selector is 
called: relying on the fact that a coercion might rescue you if the value branch does not 
correspond to the selector looks somehow hackish.

(5) -> x.i
 
   >> Error detected within library code:

   "bam" of mode Union(i: Integer,s: String) cannot be coerced to mode Integer

(5) -> x.s

   (5)  "bam"
 Type: String

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] There are questions one should not ask...

2018-06-26 Thread Riccardo GUIDA

(18) -> typeOf(())
INFO: Control stack guard page unprotected
Control stack guard page temporarily disabled: proceed with caution
 
   >> System error:

   Control stack exhausted (no more space for function call frames).
This is probably due to heavily nested or infinitely recursive function
calls, or a tail call that SBCL cannot or has not optimized away.

PROCEED WITH CAUTION.

(18) -> typeOf ()
INFO: Control stack guard page reprotected
INFO: Control stack guard page unprotected
Control stack guard page temporarily disabled: proceed with caution
 
   >> System error:

   Control stack exhausted (no more space for function call frames).
This is probably due to heavily nested or infinitely recursive function
calls, or a tail call that SBCL cannot or has not optimized away.

PROCEED WITH CAUTION.

(18) ->

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] Unexpected behavior of commas in singleton blocks {expression}

2018-06-26 Thread Riccardo GUIDA

Hi!

I bet that the behavior I describe below is well known to fricas developers,
but I report this because I find it fun and awful at the same time...

1) WARM-UP:
IF I understand well, my UG's readings, SPAD and Aldor have **different 
semantics** for commas. N>=2 below.

* in Aldor (expr1, expr2,..,exprN) is a tuple (multivalue) and {expr1; 
expr2;..; exprN}
is a sequence of expression evaluated in that order. Parentheses () and braces 
{} are
used for precedence's sake and 99% interchangeable (different behavior for 
external trailing semicolon).
Aldor allows internal trailing semicolon in blocks {e1;e2;e3;} while this is an 
error in spad.

* In Spad (expr1, expr2,..,exprN) is a tuple (not really, see point 2)
while  {e1;..; eN} **AND** {e1,..,eN} are sequences of expressions evaluated in 
the order.

OK, I find Aldor semantics much more clean & logic than that of Spad, but this 
is not the problem.

2) THE MYSTERY:
The mysterious behavior is this one: one would expect that "{expression}" has a 
value equal to "expression,
but this is NOT the case in the interpreter if "expression" is a tuple.

(1) -> {1;2;3} -- this is a sequence of expressions in a block, OK.

   (1)  3
Type: PositiveInteger
(2) -> {1,2,3} -- this is a sequence of expressions in a block, OK.

   (2)  3
Type: PositiveInteger
(3) -> 1,2,3 -- tuple

   (3)  [1, 2, 3]
 Type: Tuple(PositiveInteger)
(4) -> (1,2,3) -- tuple

   (4)  [1, 2, 3]
 Type: Tuple(PositiveInteger)
(5) -> {"bum"}  --{expr} same as expr? YES

   (5)  "bum"
 Type: String
(6) -> {(1,2,3)}  --{expr} same as expr? N

   (6)  3
Type: PositiveInteger
(7) -> ((1,2),(3,4)) --tuple of tuples

   (7)  [(1, 2), (3, 4)]
  Type: Tuple(Tuple(PositiveInteger))
(8) -> {((1,2),(3,4))} -- tuple of tuples? NO

   (8)  [3, 4]
 Type: Tuple(PositiveInteger)

In the example above I would have expected [1,2,3] as result of (6) and 
[[1,2],[3,4]] as result of (8).

As a second choice I would have expected syntax errors because, for instance,
in (6) I try to see  "(1"  as first expression in a comma separated sequence
of expressions but it is not a well formed expression. Same for "((1,2)" in (8).

It is like the semantics of commas (,...,) for tuple is forgotten inside
a singleton block and mutated to that of a sequence.

weird feature...

regards
ric




--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] Re: weird behavior of a weird anonymous function.

2018-06-19 Thread Riccardo GUIDA

I tried also with more parentheses but same message


(3) -> (():Void +-> {free x; x:=1; local y; y:= 1; output( sin(x+y)); 
output("ciao")})(());y
   sin(2)
   ciao
 
   y is declared as being in PositiveInteger but has not been given a

  value.

(3) -> ( (():Void +-> {free x; x:=1; local y; y:= 1; output( sin(x+y)); 
output("ciao")})(()) );y
   sin(2)
   ciao
 
   y is declared as being in PositiveInteger but has not been given a

  value.


ric

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] weird behavior of a weird anonymous function.

2018-06-19 Thread Riccardo GUIDA

Hi!

I'm playing with a weird anonymous function (motivation below)
and I'm stumbling on a weird error, like if information
on a local variable y is exiting from an anonymous function,
only in a specific case.

I'm reporting this to you in case it was a bug.

(1) -> (():Void +-> {free x; x:=1; local y; y:= 1; output( sin(x+y)); 
output("ciao"); ()})() -- no problem
   sin(2)
   ciao
   Type: Void
(2) -> (():Void +-> {free x; x:=1; local y; y:= 1; output( sin(x+y)); 
output("ciao"); ()})(); output(x+1) -- no problem
   sin(2)
   ciao
   2
   Type: Void
(3) -> (():Void +-> {free x; x:=1; local y; y:= 1; output( sin(x+y)); 
output("ciao"); ()})();y --problem
   sin(2)
   ciao
 
   y is declared as being in PositiveInteger but has not been given a

  value.


Why? In the global scope, y should have been valued to a symbol or Variable(y) 
with NO type declaration.

The message is absent if y is on another line:

(4) -> (():Void +-> {free x; x:=1; local y; y:= 1; output( sin(x+y)); 
output("ciao"); ()})()
   sin(2)
   ciao
   Type: Void
(5) -> y

   (5)  y
Type: Variable(y)


ric


PS
Motivation for the weird anonymous function above (Thanks for any feedback)

I'm looking for a scoping construct that could keep clean the global environment
from a proliferation of temporary variables in interpreter computations / input 
files.

The body of functions is obviously one solution, but it is slightly boring
to define and immediately execute:

hereIDoThis(globalPars) == {...body with temporary, local variables...}
hereIDoThis(globaPars)

In Aldor the "... where ..." construct is supposed to be another scoping 
construct
but in Spad I have the impression that I can use only in domain declarations.
EG the following give me errors:
(4) -> a where a:=1
  Line   1: a where a:=1
   A
  Error  A: syntax error at top level
  Error  A: Improper syntax.
   2 error(s) parsing

(4) -> a where {a:=1}
  Line   1: a where {a:=1}
   A
  Error  A: syntax error at top level
  Error  A: Improper syntax.
   2 error(s) parsing

In Mathematica there are the command Block[{x,y,z}, statements] and 
Module[{x,y,z}, statements]
that keep x,y,z "local" (actually in Block x,y,z are global but mask possible 
global values).
All other symbols in the statements have global scope.
It is not optimal to have "global by default" but it is useful to have such 
Block-s.

So, I was trying to implement a block macro that could execute a sequence of 
statements
inside the body of an anonymous function and call it immediately.
Compared to plain functions this would avoid the explicit execution.
Compared to Mathematica Block, Module this would have the advantage
that undeclared variables in RHS of statements are local.

I ended with:

macro block(statements) == (():Void +-> { statements; () })()

... but I had the aforementioned error:

(3) ->  x:=1; y:=1; z:= 1; t:=1; block(free x; local y; x:=2; y:=2; z:=2; t:= 
2; w:=2; output([x,y,z,t])); [x,y,z,t,w]
   [2, 2, 2, 2]
 
   y is declared as being in PositiveInteger but has not been given a

  value.

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] Thoughts on Float-s

2018-06-04 Thread Riccardo GUIDA

Hi, take these as mild suggestions...

1)
I feel like if the current system of Float numbers as it is is quite 
user-unsafe (!) because it allows operations f(x,y) combining FloatS x,y with 
different number of digits resulting in the *highest* one (ie  something like 
coerce a Float to higher precision). This is a convention that gives false 
sense of security to a user that plays with the global variable digits().

Example:

(1) -> x:Float:=%pi

   (1)  3.1415926535_897932385
  Type: Float
-- all digits after 20-th will be set below to (?) zero but this is an 
arbitrary convention
-- so they are "rubbish". Analog statement if the implementation is binary.

(2) -> digits(50)

   (2)  20
Type: PositiveInteger
(3) -> x

   (3)  3.1415926535_897932385
  Type: Float
(4) -> y:Float:=%pi

   (4)  3.1415926535_8979323846_2643383279_5028841971_693993751
  Type: Float
(5) -> (y-x)/y

   (5)  0.1287414678_9751207735_7225992816_9904172693_1308680622 E -20
  Type: Float
--- the 50 digits shown above are "rubbish", just convention dependent


So my point is that ideally one should have domains no coercitions to higher 
precisions, maybe to lower ones, or user conversions. Say, domains 
Float(d:PositiveIntegers). I'm willingly not distinguishing here among absolute 
or relative precision, the problem being more general.

Of course in the present state if a user does not mix precisions (the best 
choice which should be recommended) or knows that the error is influenced by 
the lowest precision number (s)he entered, everything will be fine.


2)
Given that the precision of a Float x at runtime depends on its history and may be 
unrelated to the current value of digits(), it would be useful to have functions 
digits, precision of signature Float -> PositiveIntegers that estimate the 
corresponding quantities for a given x.

Best
ric

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] Correctness

2018-06-01 Thread Riccardo GUIDA

One big source of bogosity is '$Lisp' calls.  Some are
valid because the call is access to a primitive operation
otherwise unavailable in Spad.  Some are valid because
assumptions they make are are always satisified (like
Lisp EQ implaing equality).  But there are buch of
bogus things.  One is recently mentioned 'Factored'
issue: we can not assume that Lisp ordering predicate
will do something sensible (which essentially means
that the code should _not_ depend on order and
use quadratic algorithm).  I also noticed uses of
'mathObject2String$Lisp'.  This is fine for specific
things like strings, symbols or lists of them.  But
it is invalid when applied to general FriCAS data.
In particular 'toString' in 'src/algebra/clifford.spad'
needs to be fixed (removed ???).



Hi, maybe I'm too naive or this is too difficult, but why you do not isolate all the 
allowed $Lisp operations by creating spad wrapper functions in a "Primitive" 
domain and forbid the use of $Lisp everywhere else in the code?

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] How to enter in multi-line mode?

2018-05-30 Thread Riccardo GUIDA

Sorry for the stupid question, (good for a FAQ)

is a multi-line editing mode available when launching fricas from a linux shell? I cannot 
write "for" loops in more than one line. Thanks in advance, ric

$ fricas

(9) -> for i in 1..1000 repeat
  Line   1: for i in 1..1000 repeat
   .A
  Error  A: syntax error at top level
  Error  A: Improper syntax.
   2 error(s) parsing

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] Inaccuracies (?) in system help

2018-05-30 Thread Riccardo GUIDA

Hi, take this as a ?bug report

There are weird built-in synonyms referring to un-documented (?obsolete) 
commands )compiler (with R) and )display dependents

ric
PS: Thanks @Kurt for his hints.


1) -> )what synonym
- System Command Synonyms -
...
 )co  )compiler
 )d . )display
 )dep ... )display dependents
 )dependents  )display dependents
...

)help compiler  -- => shows the help for )compile ... does )compiler exist?

(1) -> )display dependents
   No option begins with dependents .


--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] Dependent types in Fricas interpreter (input files)

2018-05-28 Thread Riccardo GUIDA

Hi, I have a couple of questions.

1)
are dependent types supported by the interpreter (input files)?

I feel like n in the image type of defFun below is really understood ...

(1) -> )read dep-types

defFun(n:PositiveInteger):SquareMatrix(n, Integer) == sample$SquareMatrix(n, 
Integer)
 
 
   Cannot convert the value from type Symbol to NonNegativeInteger .




2)
Is there an assign function such that

assign(x,z)

would be equivalent to the statement x:= z ?


thanks for any hint, ric

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: Re: [fricas-devel] )SET-tings

2018-05-25 Thread Riccardo GUIDA

Hi RalF


I still prefer the original spelling of my name.


Sorry, the suggestion of changing name was unintentional. There is no "ph" in plain Italian so to 
compensate I tend to put "ph" in place of "f" in all foreign names & words.


I'm not interested in including such pictures into any documentation.


Neither I :)

Actually, my suggestion was to include the *content* of these pictures in the 
fricas user guide because I have the impression the information on )set there 
listed is far from being complete...


Have you ever tried )help set or )set


Well, I was trying hard to see what hyperdoc has to offer to a user and I 
forgot )help. Shame on me!


Enjoy.


Thanks, great script!


And if you like you can create more help pages of this kind at the axiom-wiki.


Thanks for the kind invitation ... You know, I'm wondering if adding new 
information there would help users or just increase the entropy of the site 
(decreasing the probability for a user of recovering the wanted information) 
...but maybe I'm joking here... :)

ric

PS:

1)
Speaking of the fricasUG book.pdf , would it be possible to show version number 
or date in the first page to let people know that the content somehow changed? 
You know, downloading and checking every time the size of the pdf file is 
tedious and I cannot find the corresponding latex file on github.

2)
Maybe you already know it, but I report the issue: the script that creates the 
API has problems with \newline \tab and \indent see the rendering of [1]


[1]
https://github.com/hemmecke/fricas/blob/master-hemmecke/src/algebra/numquad.spad

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] NIntegrate , arb, and FFI

2018-05-23 Thread Riccardo GUIDA

Sorry, I've realized that numquad [1] works on Float and not only on machine 
doubles, not bad!

Am I missing other quadrature packages  (tanh-sinh, gaussian weights)?

thanks
ric

[1] https://fricas.github.io/api/NumericalQuadrature.html?highlight=numquad


--
(1) -> f(x:Float):Float == { m:=10, n:=11; k:= (4/%pi)^n*n*m; return k* 
atan(x^m)^(n-1)*x^(m-1)/(1+x^(2*m))}
   Function declaration f : Float -> Float has been added to workspace.
   Type: Void
(2) -> digits(150);aromberg(f, 0::Float,1::Float,1.e-100,1.e-100,5,20,10)
   Compiling function f with type Float -> Float

   (2)
   [
   value
 =
  1.00_00_00_00_00_00_0
  0_00_00_00_39_1966489901_0326774346_6
  923646498_990324404
 ,

   error
 =
  0.1832202195_2810277526_5224715964_4965694315_3906127288_2189970717_33840
  04174_0332421811_9982065024_0030409954_5097041266_6646499458_3349608857_0
  722547214_8324045347 E -100
 ,
totalpts = 3842113, success = true]
   Type: Record(value: Float,error: Float,totalpts: Integer,success: Boolean)
(3) ->

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] Re: Re: Some questions about Fricas

2018-05-23 Thread Riccardo GUIDA

@Erik: this might help, but the best is to take the time to read the fricas 
user guide (as I'm myself doing) ric

fricas underlying language is strongly typed. You have to specify types (see 
f1,f2 below) or the interpreter will try to choose for you (see f3). Note that 
if you feed to f1  a float that cannot be recast to an integer without 
truncation you get an error. The last line shows how to see the signatures of 
the defined functions and their definition.

(1) ->  f1(x:Integer):Integer == x^2
   Function declaration f1 : Integer -> Integer has been added to
  workspace.
   Type: Void
(2) ->  f2(x:DoubleFloat):DoubleFloat == x^2
   Function declaration f2 : DoubleFloat -> DoubleFloat has been added
  to workspace.
   Type: Void
(3) -> f1(2)
   Compiling function f1 with type Integer -> Integer

   (3)  4
Type: PositiveInteger
(4) -> f1(2.0)

   (4)  4
Type: PositiveInteger
(5) -> f1(2.3)
   Conversion failed in the compiled user function f1 .
 
   Cannot convert the value from type Float to Integer .


(5) -> f2(2.3)
   Compiling function f2 with type DoubleFloat -> DoubleFloat

   (5)  5.289
Type: DoubleFloat
(6) -> f2(2)

   (6)  4.0
Type: DoubleFloat
(7) -> f3(x) == x^2
   Type: Void
(8) -> f3(2)
   Compiling function f3 with type PositiveInteger -> PositiveInteger

   (8)  4
Type: PositiveInteger
(9) -> f3(2.3)
   Compiling function f3 with type Float -> Float

   (9)  5.29
  Type: Float
(10) -> )display properties f1 f2 f3
Properties of f1 :
   This is an interpreter function.
   Declared type or mode:   (Integer -> Integer)
  2
   Definition:   f1 x == x
   Compiled function type: Float -> Integer
   Compiled function type: Integer -> Integer
Properties of f2 :
   This is an interpreter function.
   Declared type or mode:   (DoubleFloat -> DoubleFloat)
  2
   Definition:   f2 x == x
   Compiled function type: Float -> DoubleFloat
   Compiled function type: DoubleFloat -> DoubleFloat
Properties of f3 :
   This is an interpreter function.
  2
   Definition:   f3 x == x
   Compiled function type: Float -> Float
   Compiled function type: PositiveInteger -> PositiveInteger  


--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] NIntegrate , arb, and FFI

2018-05-23 Thread Riccardo GUIDA

Hi again

In fricasUG I cannot find mention of arbitrary precision numerical integration 
in 1D (NIntegrate in Mathematica.)  Is this feature available?

If not, have you ever thought (or, for lack of energies, at least dreamed) of 
interfacing fricas to some open source arbitrary precision C library, for 
instance Arb [1] which should have a good error control?

Actually I was wondering, does the in-fricas spad compiler support calling 
external C code like does the aldor compiler (see aldorUG [2])?

Thanks for your wise insights
ric

[1] http://arblib.org/
[2] http://www.aldor.org/docs/HTML/chap19.html

--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] )SET-tings

2018-05-23 Thread Riccardo GUIDA

Hi

My question: If one changes the default settings in the REPL by performing the  
)set ... command or implicitly via the hyperdoc menu,  are these new settings 
automatically stored somewhere and reloaded at REPL restart or are simply 
forgotten at next REPL restart (so that to permanently store settings one has 
to manually write them in the default initialization file)? It seems to me that 
the correct answer is the latter, could somebody confirm please?

BTW, is the initialization file still axiom.input or fricas.input? (The latter 
would --hypothetically--- allow for installing axiom and fricas on the same 
system with no interference.)

Aside comment:

I was looking for a list of the options and parameters for the system command 
)set, which are not explicitly shown in the fricasUG. As far as I understand 
using hyperdoc (...Settings) is the only way to see the )set 
options/parameters/default for the user because looking at sources these 
options are hard encoded and mixed with boot code in 
fricas/src/interp/setvart.boot.

For new users (and my) reference I attach 2 screen captures that show the 
available settings in full screen mode as I saw them. @Ralph it would be really 
great to have these lines listed in fricasUG.

ric   



--
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] CAS integration tests

2018-04-24 Thread riccardo . guida
Hello again.

I write the question here because I think that Nasser Abbasi is in the list  
and maybe he could comment on this topic that in my view is quite important for 
FriCAS.

I was eager to know the results of Nasser's test [1]  with Rubi' integration 
suite, which includes Maple, Mathematica and (beginning 2018) also FriCAS. 
Having a good rating in comparison with M&M would obviously be a very good 
advertisement for FriCAS ...but apparently  FriCAS is not included in the final 
 result with 7 10^4 integrals, only in the small benchmark.  Why? Is this a 
problem that can be fixed?

Thanks for any information
riccardo


[1]https://www.12000.org/my_notes/CAS_integration_tests/index.htm


-- 
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] FriCAS contribution

2018-04-24 Thread riccardo . guida
Hi to all.

Let me clarify my point of view on the question raised by Ralf' post

@Waldek: please take it as friendly, constructive criticism.

Maybe I'm wrong, but following the exchanges in the fricas-devel list I've got 
the impression that development proceeds in a suboptimal way due to a lack of 
coordination in the tasks that should be pursued and in the way to pursue them. 
And this with just a really minimal staff of 1 project leader and 2 active 
developers!  The current way of proceeding would be definitely unbearable in 
the ideal case when project would capture more skillful developers.

My general idea is that a minimal to do list should be established in some way 
by the project leader, organizing the tasks by difficulty and priority level.

A good way to proceed in these cases is to learn from other healthier open 
source projects. Take Sympy, for instance. They manage to proceed with tens of 
active developers (and a dozen of new gsoc students per year).  I think that 
the most important lesson to learn for FriCAS is that they have an issue list 
in which all the issues (bugs and new features) are posted and  labeled by 
topic and by difficulty [1] (maybe they have too much labels).

My suggestion is that the project leader should invest a small fraction of his 
time time in preparing a short list of tasks, classed by say 2-3 levels of 
difficulties:  hard, medium and "Easy to fix". More labels on topics might also 
be useful.

I do not know if the "easy to fix" label might capture new volunteers but it is 
a good way to tempt people to participate. Furthermore having a "hard/medium 
difficulty" would improve the effectiveness of the work of Ralf and oldk3113.

The list can be done on an ascii file but of course having an issue list like 
that on github would have the advantage of  being a way to organize, store and 
archive bug reports and their historical evolution, better that posts on a 
mailing list.

my best regards,
riccardo

[1] 
https://github.com/sympy/sympy/issues
https://github.com/sympy/sympy/issues?q=is%3Aissue+is%3Aopen+label%3A%22Easy+to+Fix%22
https://github.com/sympy/sympy/labels/Needs%20Better%20Patch


-- 
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] Re: sbcl-1.4.5 causes problems

2018-03-02 Thread riccardo . guida
https://git.wiki.kernel.org/index.php/GitSvnCrashCourse

:)

-- 
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] FriCAS packages in Linux

2018-02-27 Thread riccardo . guida
Hi,

For the record, a page listing Linux distributions/repositories with FriCAS 
packages and their versions:
https://repology.org/metapackage/fricas/versions

ric

-- 
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] FriCAS status

2018-02-20 Thread riccardo . guida
Hello Waldek

Wish: If you plan to release binaries, would it be possible to compile and 
release in some contrib directory also the binaries of Kurt Parentani's 
fricas_jupyter [1] ... if the code works and Kurt agrees, I mean.

Regards Riccardo

[1] https://github.com/nilqed/fricas_jupyter

-- 
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] Impressions

2018-02-15 Thread riccardo . guida
@oldk1331:
>3. Online shell.  I may produce a online shell similar to sympy in the next 
>few (3~6) months.

 ... nice, but it is not me who decides what is urgent or not.

@oldk1331:
>TeXmacs interface could provide more functionality than jupyter,
>as the latter uses a web interface.  

I know TeXmacs...  "thermonuclear bomb" was intended to be a positive statement.

@oldk1331:
>And you are right that TeXmacs
>requires guile-1.8 which makes it more difficult to install. TeXmacs
>and FriCAS faces a similar problem: lack of developers, which is
>unfortunate for those promising projects.

Sure ...  I found a TeXmacs developer saying he is working on porting TeXmaX to 
guile 2.x
http://texmacs-users.texmacs.narkive.com/7OqIM2U4/how-can-i-use-guile-2-0#post6

ric

-- 
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] Impressions

2018-02-15 Thread riccardo . guida
Dear Waldek, 

thanks for your explanation on FriCAS long term goals. Below a few, mild 
replies.

> In general
> you need to figure out what package manager given disto uses and what
> flavour of packages it needs.  That already two extra steps compared to
> using a tarball (OK, using a tarball you need to know if you run 32
> bit distro or 64 bit one and you are out of luck if the machine is
> not PC-compatible, but still simpler).

Mmm... you are skipping  "...with a guarantee of future automatic upgrades.":
I do "apt-get install" once, then I "apt-get dist-upgrade" (or apt-get 
safe-upgrade") and all the software in my machine is up to date with no 
effort what is simpler for a lazy|busy user?

>_You_ may voice request at distribution to include FriCAS. 

OK, could be better written, but done:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890525

I guess that FriCAS users interested in having binaries  distributed by debian, 
if any around, should support my request for a new package fricas (reportbug, 
package: wnpp, bug: 890525), otherwise it will have zero measure...

> Does it matter much what is official?

Right, bad wording: replace "official" by "reliable".

> That is a wiki: by definition it is unstructured and disorganised.

Just for nut-picking's love: "Unstructured by definition" OK, but 
"disorganized" is not necessary the case if the goal of the wiki is to transmit 
information to users. I do not know the current software, but in eg Mediawiki 
you may organize articles in a graph of categories just by adding simple tags 
like [[SPAD]], [[Install]], [[Integration]], [[History]], [[Beginners]] and 
have the category page automatically generated. Overview or starting point 
pages describing stable content may be manually added  for tree-like reading.

Best,
ric

-- 
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] Impressions

2018-02-11 Thread riccardo . guida
Dear Andrey,

Thanks for your reply. Below some additional explanations on my post.

On 2/10/18 7:59:24 AM CET Andrey G. Grozin  wrote:
> On Fri, 9 Feb 2018, riccardo.gu...@gmail.com wrote:
> >  Well,  by definition, NO user will ever manually compile a source code.
> Well, I never run any program which I have not compiled myself. I use 
> Gentoo Linux, by the way. Call it paranoia, but I don't trust binaries 
> whic can contain anything, and I cannot know what they really do.

Andrey, I can imagine what you do with FriCAS in your multi-loop calculations, 
and I would class you in the "power-user" category not in the definition of 
"average simple user" I gave in the post.

I want  to pinpoint that in my post by "manually" I meant:
Read the list of dependencies and their versions, compare with what you have.
For all needed tarballs: cd somewhere; wget the-package && tar -x && make && 
make install"
Repeat this every time a new version comes out and for every laptop/desktop you 
have.

That said, the"hypotethic average user" I described has nothing against 
compiling from the sources if this can done be done easily, painlessly, and 
flawlessly as it is done in Gentoo. I discover happily that there is a FriCAS 
package in Portage, so a simple "emerge" will do the first install job and one 
"emerge -e system && emerge -e world" from time to time will keep upgraded the 
whole status. My "average user" would accept that.

> > The fricas binaries I downloaded worked, but an average user has to 
> > figure out how to proceeed with the tar file.
> 
> I think it's one of the first things any Linux user learns.

Well, Linux today is much easier than Linux 20 years ago, but I admit that I've 
exaggerated a little...

In my defense I cite the excellent Gentoo handbook: they never hesitate to 
explicitly write down step by step instructions. Here they do explain how to 
untar a package:
https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Stage#Unpacking_the_stage_tarball

> > --- Texmacs has a built-in fricas plug-ins. Problem here: texmacs is 
> > kicked out of debian because of dependency on guile.
> TeXmacs and its FriCAS interface work fine (though I prefer the ascii 
> repl - TeXmacs is slow on long formulas). It's trivial to compile 
> guile-1.8.x and TeXmacs-1.99.6.

Of course I can do that, just I do not know if my "hypothetic user" would find 
that trivial

Just for the record, here are the links that explain in detail why texmacs has 
no package in debian
(removed from testing on 2013-10-15, removed from experimental on 2016-05-25 )
https://tracker.debian.org/pkg/texmacs
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=797833

> >  --- The project   fricas_jupyter (with binaries) looked interesting but 
> > one is required to have binaries compiled with SBCL 1.2.x . 
> > Unfortunately the official released binaries are made with sbcl 1.1.1 
> > so I dropped this solution.
> WHAT? Both versions are ancient. The current sbcl is 1.4.4, and I use it 
> everywhere. When a new sbcl appears, I compile it, and re-compile FriCAS 
> and maxima.

I'm innocent here: protest with the person who compiled FriCAS 1.3.2 and 
released the binaries...

Best
ric



-- 
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] Impressions

2018-02-11 Thread riccardo . guida
Dear Ralf

having a status-of-the-project message somewhere in the official site  would 
indeed be quite useful for new users.

That said, your message transmits a feeling of sadness :)  I advice you to be a 
little more positive, like eg:

FriCAS is a relatively young project. There is a group of developers who 
actively work to refactor, improve and debug the existing code.

For lack of energies, the documentation of the project is still in a 
work-in-progress status and heavily relies on AXIOM's one. Expect multiple 
sources, inaccuracies, ...  We are aware of that and we hope to improve the 
situation as soon as possible. In the meanwhile, we understand that it might be 
frustrating for a new user to install, learn, and use FriCAS. If this is your 
case, please do not give up and write an email to fricas-devel@googlegroups.com 
. Usually, one of the developers is around and will try to assist you to 
overcome your frustration.

> I want to make fricas.github.io the main portal for FriCAS, but there is
> still a lot to do. When I find time, I will put the code that produces
> the documentation to github, maybe then others find a channel to send
> pull requests.

Very good idea! Also the FriCAS-latex-Book should be in a git repo.

ric

PS With no urgency at all, could you set my receiving preferences on 
fricas-devel to "no emails"? I preferer to read online when I have some time. 
Thanks.

-- 
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] Impressions

2018-02-09 Thread riccardo . guida
Hi

Ralf & oldk1331 asked me to detail my first impressions as a user approaching 
FriCAS. Below you'll find a reasoned (time-consuming) list where I tried to 
(fearlessly and pitilessly) pinpoint what appears to be "sub-optimal". Of 
course it migh well be that I'm missing some important point or that I'm 
completely wrong.  Take these remarks just as sample of what an average user 
might feel when approaching FriCAS.

Please do not be upset or hurted!!! ...and also PLEASE do not ask me to fix all 
these issues for you :)

By user below I mean a person with good mathematical skills, minimal 
computer skills, high aesthetical sense, and very very limited patience to fix 
things. (Sorry, but users are done this way, I know my colleagues...)

I understand that the fricas project needs developers, but capturing a lot of 
users is  a good way to interest (young) developers. (See PS at bottom page.)

 1) INSTALL.
Well,  by definition, NO user will ever manually compile a source code. 
Furthermore a user has no virtual machines and just one working environment 
which she does not want to screw up if something goes wrong.

The fricas binaries I downloaded worked, but an average user has to figure out 
how to proceeed with the tar file. A step by step "for dummies" explanation is 
important.  (This is missing in INSTALL-bin.txt) . I'm at higher computer level 
so to me the problem was  hate for manual install and paranoia, so I had to 
take the time to read the tar contents (I did not like to have usr and 
usr/local system directories in the tar), write a script that untars, installs, 
and creates hashes of all files to check for corruption. This took time...

COMPARE with (eg  debian's)  """ $ aptitude install  axiom """ which in seconds 
installs everything with no problems of reading instructins, broken installs, 
broken environment, security, and with a guarantee of future automatic upgrades.

Having linux packages is strategic. I've seen here and there on fricas-devel 
remarks about having debian packages soon but after months I do not see the 
packages in debian repository. Having Mac/Windows installers would be surely 
helpful, but I do not know how difficult it is, so I stop here.

2) WEBSITE(S).
The site fricas.sourceforge.net is simple and effective but it refers to a 
"fricas wiki" (axiom-wiki.newsynthesis.org) and to a "fricas API" 
(http://fricas.github.io/api/genindex.html).

The site fricas.github.io looks nice, and modern  the API is as well very good 
and modern (but it does not include all, where are the system commands??). Had 
a good impression so I started  browsing it, discovering that there is more 
information. Happy but now confused, "what is official and what not official"?

The axiom-wiki.newsynthesis.org contains a lot of useful information but (sorry 
to the maintainer!) looks old-fashioned,  weakly mantained, and unstructured: 
in practice it is difficult to extract information the first times. What human 
being can take profit of this page: 
http://axiom-wiki.newsynthesis.org/FrontPage/contents ? (I must say that after 
3 weeks of browsing there I've just  discovered the 
http://axiom-wiki.newsynthesis.org/SiteIndex glossary, which is much helpful 
that the contents page. I know I know the "Site index" link is just below the 
"Content index" but I am a user so I'm dumb! )

 Well, no big problems here but my advice is that there should be just one 
website (possibly modern and nice-looking like fricas.github.io) with all the 
relevant infomation structured in an accessible wayy.

COMPARE with www.sympy.org : beautiful, no comparison...

3) ONLINE SHELL.
Not strategic but many CAS have it.

Writing \begin{axiom}\end{axiom} at each command is *TEDIOUS*. Furthemore I 
couldn't find a way to enlarge the window.

COMPARE with http://maxima-online.org/ http://live.sympy.org/  

4) Latex friendly GUI. 
It is *important*!!! The 2D output of fricas kernel is difficult to read. (BTW 
I would definitely  prefer a plain output equal to the input form but I cannot 
find how to do it. Fortran or the weird script-stuff are not useful for plain 
reading of results.) Users want to see nice formulas! 

I looked for information... nothing of official. I digged more and more and I 
found the following:

--- Texmacs has a built-in fricas plug-ins. Problem here: texmacs is kicked out 
of debian because of dependency on guile. So I took the time to read inatsll 
instructions and I've installed the binaries ... and it did not work. Result: 2 
hours wasted in trials. Anyway, I'm confident that one day might work, but my 
**personal** opinion is that using texmas to output CAS results is like using a 
termonuclear bomb to kill the mosquitos in your bedroom. The good alternative 
is Jupyter: Mathematica-like, modern, supported, widely known and relatively 
light. so

--- I went to the official list of jupyter kernels, 
https://github.com/jupyter/jupyter/wiki/Jupyter-kernels  and I found ... 
NOT

Re: [fricas-devel] Question on evaluation (2)

2018-02-05 Thread riccardo . guida
Hi again, 

just for reference, a simple and quite precise explanation of evaluation in a 
proposed variant of A^# called B^#  is available here:  [JenksTrager94]  at p 
39. The authors say that evaluation in B^# corresponds to scratchpad and Common 
Lisp, so I *hope* that it is what is used by Axiom/FriCAS. If you know of 
similar/better references, please let me know, there are tons of articles out 
there.

Greetings
ric
  
 [JenksTrager94] 
http://axiom-wiki.newsynthesis.org/public/refs/axiom-scratchpad.pdf

-- 
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] Question on evaluation (2)

2018-02-05 Thread riccardo . guida
Dear Ralf, oldk1331 and Themos, thanks for your answers.

I'll comment on/answer various points below and I'll make up a list of my 
impressions in another "constructive criticism" post.

>That's an interesting skill set.  May I ask how did you get in touch
>with FriCAS?

I heard about Axiom more or less when I ended my  PhD and Axiom was commercial. 
At that time I computed in Macsyma (without x). Then in my post-doc I started 
using Mathematica. Got a job and more time for "CAS fun", I started to look 
around for viable Open Source alternatives to Mathematica (say beginning 2000). 
I became aware that Axiom was OS but I was scared by the immensity of its 
documentation, the strong type system,  and by what seemed to me a slow source 
development. I followed the Aldor transition to OS looking from time to time at 
the forum, and after a while I realized that there were no more one but three 
"Axioms" around. FriCAS looks to me the healthier project. (The strong type 
system fear evaporated meanwhile thanks to a little immersion in Haskell.)

Concerning my question on evaluation, the motivation is just theoretical,  to 
understand the evaluation mechanism: I have no precise application in mind.

@oldk1331 and @Themos, thanks for suggesting delayed assignment. I knew about 
==. If I write (a==b; b==1; a) then a is evaluated with b bound to 1. The post 
was more about understanding of "what is a on the LHS and b on the RHS of the 
assignment", that why I used := .

@oldk1331: 
>Do you have any problems on installation?
I've installed installed the binaries in a test machine (linux debian) this we. 
I'll talk about problems I faced in the "constructive criticism" email.

@oldk1331: 
>The "fixed-point infinite evaluation" sounds like delayed assignment
>I mentioned above.
Mmm... in my Mathematica-biased understanding, immediate evaluation and delayed 
evaluation refer to *when* the RHS of an assignment is evaluated, at the 
assignment time or when a variable is re-used. My question was not about when 
evaluation is performed but more about *how* evaluation is performed. In 
Mathematica assignments ( = immediate and := delayed)  define immediate or 
delayed global rules that are stored somewhere in the environment and 
evaluation means "repeatedly apply all the rules in scope until the result does 
not change". That is what I meant by  "fixed-point infinite evaluation" and the 
they point is the fact that the rules are repeatedly evaluated. 

@oldk1331: 
> BTW, is this possible in Sympy?
In my knowledge, in Sympy  the LHS of an assignment is a plain python variable 
and in the RHS one has an object representing a mathematical object, say an 
expression. Assignment of a python variable is immediate (unless one cheats and 
uses a nullary function, but that has an heavy function-like syntax). There is 
no rule-storing and repeated application as in Mathematica. I'm not aware of a 
way to automatically have this fixed-point evaluation. On the other hand I 
guess that if one has an *explicit* list of rules one might create a function 
that applies them until the result is fixed.

@Ralf 
Thanks for your enlightening explanation!

If I understand correctly, the "variables" on the LHS of assignments are Aldor 
(whatever) variables that are bound (refer to)  to  more complicated Aldor 
objects with type in some domain, like Variable(b).

Let me write down another example to test if I've understood (could you tell me 
if I'm wrong?) 

a:=a 
 -- "a" on the LHS is an Aldor variable (a reference to an object) , "a" on the 
RHS is an object of type Variable(a) coercible to Symbol.  

a:=1
-- "a" on the LHS is the same  Aldor variable as above. "a" now reference to 
"1:Integer" and the value a:Variable(a) -- no mor linked -- disappears from the 
scope. 

f(x) == x+a  -- who is "a" on RHS?
f(z)
--- => z+1  so "a" above was an Aldor variable

If my understanding is correct, the situation is pretty much like Sympy, [1], 
where you would write the above test as

a = Symbol("a")
   -- "a" on  LHS a python ref. On the RHS you create explicitly a Symbol 
object named "a".

a = 1
  -- "a" on  LHS a python ref. 
def f(x): return x+a
-- "a" on  LHS a python ref, presently bounded to 1.

f(Symbol("z"))
-- returns Symbol("z")+1, which is shown as z+1

[1] http://docs.sympy.org/latest/gotchas.html#variables

>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.

I understand. (Actually it seems that also mathemagix [2] does it :)  but I'm 
not a mathemagix user. )
[2] http://www.mathemagix.org/www/multimix/doc/html/multivariate.en.html

Thanks,
ric

-- 
You received this message because you are subscribed 

[fricas-devel] Question on evaluation (2)

2018-02-05 Thread riccardo . guida
Dear Fricas developers

(I'm and not sure that this is the good forum to address my question, but I 
cannot find any other.)

First, thanks you all for your engagement to keep this great project alive!

I'm a researcher in theoretical & mathematical physics with some knowledge (at 
different levels) of Mathematica (the current standard in th phys), Sympy, 
Maxima and Haskell. (No Lisp/Boot/Spad/Aldor alas!)

In these days I'm trying to learn Fricas and I'm playing with the online 
sandbox.

(As a sad aside, I must say that the current status of fricas installation & 
language documentation is "sub-obtimal" (I can give more details if you're 
curious). One must be much much more motivated than an average cas-beginner not 
to run away, to stay &  progress. Of course this is not a blame, I understand 
that these tasks are tedious & heavily time consuming, and I see that there is 
some promising effort in progress.) 

The first thing I like to understand about a CAS is how evaluation works ...so, 
unable to find this topic on the documentation, I did some trials... And here's 
my question:

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?

This one-level evaluation behavior is similar to the one found in masyma, but 
there there is ev(a, infeval) which does the job and one gets 1.
On the other hand Mathematica uses fixed-point infinite evaluation by default 
so it returns 1 for a.

The answer:
eval(a, 'b = b)
returns 1 but it  is not satisfactory to me because it requires the apriori 
knowledge of all the variables involved in Value (a).

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

Thanks for your time

ric

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

-- 
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.