Re: [fricas-devel] Airy, Bessel and hypergeometric functions

2021-04-08 Thread Kurt Pagani
Oh, I must have had some other Fortran code in mind (Gautschi has only $p\in
(0,1)$, indeed).

https://jblevins.org/mirror/amiller/

I guess it was the one below, but there are some others (CTRL-F Bessel ...)
https://jblevins.org/mirror/amiller/cbsslj.f90
cbsslj.f90 Complex Bessel function J_{\nu}(z) where both the argument, z, and
the order, \nu, are complex.

Anyway, it makes hardly sense to convert F90 to fricas, but it may be helpful
for comparing purposes.





On 08.04.2021 20:06, Waldek Hebisch wrote:
> On Thu, Apr 08, 2021 at 07:17:42PM +0200, Kurt Pagani wrote:
>> Maybe you are already aware of
>>
>> COMPUTATION OF BESSEL AND AIRY FUNCTIONS AND OF RELATED GAUSSIAN QUADRATURE
>> FORMULAE by WALTER GAUTSCHI
>> https://www.cs.purdue.edu/homes/wxg/selected_works/section_02/169.pdf
> 
> Thanks for reference.
> 
>> The code is in Fortran though.
>> https://www.cs.purdue.edu/archives/2001/wxg/codes/
>>
>> IMO it would be easier, however, if we took it from GSL:
>> https://www.gnu.org/software/gsl/doc/html/specfunc.html
>> Bill  wrote an interface: 
>> https://github.com/billpage/gsla/blob/master/gsl.lisp
> 
> Both ilutrate what I wrote: Gautschi has 0 has real arguments.  As I wrote, there are good looking
> implementations for real p (and complex x).  A have a toy
> multiple precision implementation, it is fast enough
> if arguments are resonably small.  OTOH our Bessel J and
> H01 also seem to havve resonable accuracy when arguments
> are small.  The problem is large arguments.  Also, it
> would be silly to use multiple precision implementation
> to get double accuracy, but do not provide real multiple
> precision implementation.  But with multiple precision
> results problem of large arguments gets worse...
> 
> Just to be clear: in case of Airy we can try to hide
> bug, that is provide low accuracy version.  That
> would be easy, but the accuracy problem would come back
> later.  The point is to sort out the mess so that
> it works.  And ATM it seem that nobody else did this
> in really satisfactory way, so appearently we should
> be first to do this. 
> 

-- 
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/425b014f-d3b4-b62f-b694-2c57be034a6e%40gmail.com.


Re: [fricas-devel] Airy, Bessel and hypergeometric functions

2021-04-08 Thread Kurt Pagani
Maybe you are already aware of

COMPUTATION OF BESSEL AND AIRY FUNCTIONS AND OF RELATED GAUSSIAN QUADRATURE
FORMULAE by WALTER GAUTSCHI
https://www.cs.purdue.edu/homes/wxg/selected_works/section_02/169.pdf

The code is in Fortran though.
https://www.cs.purdue.edu/archives/2001/wxg/codes/

IMO it would be easier, however, if we took it from GSL:
https://www.gnu.org/software/gsl/doc/html/specfunc.html
Bill  wrote an interface: https://github.com/billpage/gsla/blob/master/gsl.lisp



On 08.04.2021 18:13, Waldek Hebisch wrote:
> This is mainly to let you know why bug fixes take so much
> time.  There is old bug, namely our numeric Airy functions
> fails for positive real arguments (and gives quite wrong
> results for some complex arguments).  Problem is that
> our current formula for Airy Ai uses Bessel functions and
> square root.  For some arguments (including positive reals)
> we get wrong branch of square root and conseqently
> completely wrong result.  Mathematically, fix
> looks easy.  Namely there is formula for Airy Ai:
> 
> Ai(x) = (3)^(-2/3)*(1/Gamma(2/3))*H01(2/3, (1/9)*x^3) -
> (3)^(-1/3)*(1/Gamma(1/3)* x*H01(4/3, (1/9)*x^3)
> 
> where H01 is hypergeometric function.  H01 is analytic
> for all complex x, so no problem with branches.  But
> it has two problem, one fundamental.  First, for
> positve reals H01 grows quite fast while Ai decays fast.
> So we are subracting two large numbers to get tiny
> difference, which leads to significant loss of
> accuracy (this is fundamental problem).  This one can
> be corrected by expressing Ai in terms of Bessel K
> function (this only for limited set of arguments, as
> outherwise we would get back problems with branches).
> However, our Bessel K uses formula that is similar
> to expression for Ai above, and in particular has
> the sane problem with loss of accuracy that we are
> trying to avoid...
> 
> Other problem is that for some arguments our H01 is
> quite inaccurate.  Now, H01 is closely related to Bessel
> J function:
> 
> H01(p, x) = (sqrt(-x))^(-(p-1))*Gamma(p)J_{p-1}(2 sqrt(-x))
> 
> For efficiency it makes some sense to have separate
> special method for Bessel J and for H01, but one
> can use common method just doing little adjustment
> implied by equation above.  Certainly, there is no
> reson to have significant difference in accuracy.
> For positive reals formula for H01 means that we take
> square root of negative number, that is evaluate
> Bessel J at imaginary arguments.  Alternativly, one
> can use Bessel I function.  Again, for complex arguments
> Bessel J and Bessel I are closely related and one
> can use common method.  But our (Boot) code for
> Bessel J and Bessel K differ quite a lot.  In particular
> Bessel I raises error for most arguments.  This means
> we have not only problem with Airy functions, but
> also we have problem with Bessel functions (and H01).
> 
> I looked at methods used to compute Bessel functions.
> There are some:
> - direct use of power series (good only for small x)
> - asymptotic expansions (needs large x or p)
> - Chebyshev series (moderate arguments)
> - recurences
> 
> There are several asymptotic expansions, each with its
> validity conditions and with different errors.  It seems
> that most expansions are given without error bounds, so
> it is not clear where they are really useful.  Recurences
> have problem with stability, some are claimed stable,
> but this is probably valid only for real p and real x.
> My calculations suggest that in "interesting" ranges
> of p and x recurences are unstable.  What looked
> like easy bugfix expanded to a research program...
> 
> Anyway, it took some time and I probably will postopone
> fixing this one past current release.  But there are
> few other "easy looking" potential fixes...
> 
> BTW: Obvious thing to do is to look at other implementations.
> ATM I have not found "full range" implementation, that
> is one giving good accuracy for all arguments where
> function may be computed (there good looking implementations
> for real p).  According to various papers Mathematica
> is using multiple procision which gives good accuracy,
> but is so slow for some arguments that range is
> limited by compute time.  AFAICS the same it true of
> mpmath.
> 

-- 
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/07d9bb7d-d412-0d06-a619-7f46cd65a2f9%40gmail.com.


Re: [fricas-devel] 4ti2 and )set message time on

2021-04-15 Thread Kurt Pagani
On 16.04.2021 00:39, Waldek Hebisch wrote:
> On Thu, Apr 15, 2021 at 05:59:54PM +0200, Ralf Hemmecke wrote:
>> I am calling an external program in a .spad file like this:
>>
>> systemCommand(cmd)$MoreSystemCommands
>>
>> where cmd is
>>
>> "system /usr/bin/zsolve-4ti2 DATA"
>>
>> When I switch on timing I get something like and call the function from
>> my .spad file, I get
>>
>> Time: 0 (IN) + 0.04 (EV) + 0.00 (OT) = 0.05 sec
>>
>> although the actual computation (via 4ti2) took actually longer than one
>> minute.
>>
>> Understandibly, the time spent in FriCAS is negligible, but is there
>> some way to tell FriCAS to show the time spent in the external computation?
> 
> ATM no.  This requires support in operationg system which in turn
> would require support in Lisp.  

According to
https://stackoverflow.com/questions/6065446/executing-a-shell-command-from-common-lisp,
"uiop:run-program" is a viable solution.
"Trivial shell" also works fine: https://common-lisp.net/project/trivial-shell/,
however, requires some installations, whereas "uiop" loads with "(require 
:asdf)".

syscmd(s) ==> systemCommand(s)$MoreSystemCommands
lisp1(s)  ==> syscmd(string(FORMAT('NIL,"lisp ~A",s)$Lisp))

Example: sleep 2 sec

lisp1 "(require :asdf)"
lisp1 "(time (uiop:run-program _"sleep 2_" :output *standard-output*))"

thus:

mysys(cmd) == lisp1(FORMAT('NIL, "(time (uiop:run-program _"~A_" _
:output *standard-output*))", cmd)$Lisp)


(11) -> mysys "sleep 4"
   Compiling function mysys with type String -> Void
Evaluation took:
  4.049 seconds of real time
  0.00 seconds of total run time (0.00 user, 0.00 system)
  0.00% CPU
  4 forms interpreted
  12,522,875,702 processor cycles
  65,504 bytes consed

> We probably could do this using
> implementation specific features, but up to now nobody implemented
> it.
>

Would it be wortwhile at all? IMO everyone can piece together a function using
the simple lisp constructions mentioned above.




-- 
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/94acb964-33c6-182d-4175-b5556d15cef3%40gmail.com.


Re: [fricas-devel] INSTALL

2021-04-19 Thread Kurt Pagani
On 19.04.2021 21:26, Waldek Hebisch wrote:
...
> 
> Mainly the second, INSTALL should be readable as plain text.
> It is OK to have marked up version as master source.  Some
> markup formats can produce decent looking plain text versions
> (IIUC sphinx is supposed to produce text version, but ATM
> this does not work for me so in particular I can not see
> if this is good enough).  Another issue is dependency. .rst
> is claimend to be ligtweight, but supporting programs are
> rather large...

That's true, however, there are a lot of little helpers around, e.g.

Emacs Support for reStructuredText
https://docutils.sourceforge.io/docs/user/emacs.html

> 

https://pandoc.org/MANUAL.html

This (usually) provides good results:

pandoc --from=rst --to=plain filename.rst

OTOH --from=plain --to=rst is not always what you'll expect.




-- 
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/b381a783-5971-3bb8-6679-e9ffdf1d8cdd%40gmail.com.


Re: [fricas-devel] inverting matrixes over rings

2021-04-13 Thread Kurt Pagani
On 13.04.2021 11:35, Prof. Dr. Johannes Grabmeier privat wrote:
> the FriCAS code for inverting matrices over R is not correct. If wished
> I can provide the necessary changes to matfuns.spad

From my side, please do ;)

(2) -> IU := inverse(U)@Matrix(R)

   An expression involving @ Matrix(IntegerMod(26)) actually evaluated
  to one of type Union(Matrix(Fraction(Integer)),"failed") .
  Perhaps you should use :: Matrix(IntegerMod(26)) .

(2) -> IU := inverse(U)::Matrix(R)

+1  24+
   (2)  | |
+0  1 +
 Type: Matrix(IntegerMod(26))


)sh Matrix(R) => provides no inverse, indeed.


> 
> Problem: recip returns "failed", inverse coerces to Fraction Integer:
> 
> (1) -> R := IntegerMod 26
> 
>    (1)  IntegerMod(26)
>   
>    
> Type: Type
> 
> (2) -> U : Matrix R := [[1,2],[0,1]]
> 
>     +1  2+
>    (2)  |    |
>     +0  1+
>    
> Type: Matrix(IntegerMod(26))
> (3) -> recip U
> 
>    (3)  "failed"
>   
> Type: Union("failed",...)
> (4) -> inverse U
> 
>     +1  - 2+
>    (4)  |  |
>     +0   1 +
>   Type:
> Union(Matrix(Fraction(Integer)),...)
> 
> 
> The desired result should be the following:
> 
> (72) -> inverse U
> 
>  +1  24+
>    (72)  | |
>  +0  1 +
>  Type:
> Union(Matrix(IntegerMod(26)),...)
> 
> 

-- 
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/94649bb7-c3dc-07b3-d27e-2038de129d2c%40gmail.com.


Re: [fricas-devel] Interfacing C functions (with SBCL)

2021-04-13 Thread Kurt Pagani
The problem seems to be known for a long time. It works when "compiled" but not
when interpreted.

https://bugs.launchpad.net/sbcl/+bug/1731556
https://bugs.launchpad.net/sbcl/+bug/992362
https://bugs.launchpad.net/sbcl/+bug/734259


Note: I added a "(in-package :cl-user)" top in your test.lsp, otherwise you are
in package "BOOT" where symbol conflicts may occur, e.g. (coerce 0 
'double-float):


   FriCAS Computer Algebra System
Version: FriCAS 1.3.5
Timestamp: Mi, 17. Apr 2019 03:15:11
-
   Issue )copyright to view copyright notices.
   Issue )summary for a summary of useful system commands.
   Issue )quit to leave FriCAS and return to shell.
-

   Function declaration sixel : TexFormat -> Void has been added to
  workspace.
   Type: Void
   Function declaration quickLoad : String -> Void has been added to
  workspace.
   Type: Void
(3) -> )lisp (load "test.lsp")

Value = T
(3) -> )lisp (compile "test.lsp")

   >> System error:
   Invalid function name: "test.lsp"

(3) -> )lisp (compile testfun)

   >> System error:
   The variable TESTFUN is unbound.

(3) -> )lisp (compile 'testfun)

   >> System error:
   The function BOOT::TESTFUN is undefined.

(3) -> )lisp (compile 'cl-user::testfun)

Value = COMMON-LISP-USER::TESTFUN
(3) -> )lisp (testfun 10.0d0)

   >> System error:
   The function BOOT::TESTFUN is undefined.

(3) -> )lisp (CL-USER::testfun 10.0d0)

Value = #C(10.0 31.402)
(3) ->



This link may ALSO be helpful:
https://stackoverflow.com/questions/21353376/how-to-use-double-float

Although I find it realy ghastly interfacing C in fricas (but if, why not using
CFFI?)

>   The value
> 0.0d0
>   is not of type
> (SB-ALIEN:ALIEN (* T))


)lisp (defun |foo| (x) x)
foo(7)$Lisp -> 7
foo(7.2)$Lisp ->  (265633114661417543270 . - 65)
foo(7.2::DoubleFloat)$Lisp ->  7.199

)lisp  (coerce 0 'double-float)
)lisp (defun mycoerce (x) (cl-user::coerce x 'double-float))





On 13.04.2021 03:03, Tobias Neumann wrote:
> I've noticed that FriCAS doesn't have a numerical implementation of polylog's 
> yet.
> So I will have to interface some C/Fortran code. For that I have constructed 
> a small
> example:
> 
> test.c:
> void testfun(double arg, double* realpart, double* imagpart)
> {
>     *realpart = 1.0 * arg;
>     *imagpart = 3.14 * arg;
>     return;
> }
> gcc -shared -o libtest.so test.c
> 
> test.lsp:
> (sb-alien:load-shared-object "./libtest.so")
> (defun testfun (arg)
>     (sb-alien:with-alien ((repart (double-float) 0.0d0) (impart (double-float)
> 0.0d0))
>         (sb-alien:alien-funcall
>           (sb-alien:extern-alien "testfun" (sb-alien:function sb-alien:void
> (double-float) (* double-float) (* double-float)))
>           arg (sb-alien:addr repart) (sb-alien:addr impart)
>          )
>         (complex repart impart)
>     )
> )
> 
> And I can successfully use that function within sbcl:
> sbcl --load "test.lsp"
> (testfun 10.0d0)
> #C(10.0d0 31.402d0)
> 
> Within FriCAS I ran ")lisp (load "test.lsp")" and it
> seems to parse/load the file successfully, but I can't directly use that
> function, i.e.  (testfun 10.0d0) within ")fin", and neither from within FriCAS
> as TESTFUN(1$DoubleFloat)$Lisp:
> 
> debugger invoked on a TYPE-ERROR in thread
> #:
>   The value
>     0.0d0
>   is not of type
>     (SB-ALIEN:ALIEN (* T))
>   from the function type declaration.
> 
> As it turns out, somehow I can not give it an initial value here, and I just
> have to declare it with (repart (double-float)), which is fine, but I am
> wondering why.
> 
> The final step for me is to convert the SExpression into a FriCAS
> Complex(DoubleFloat). For that I looked into the SExpression domain, and it
> seems to be easiest to instead return (list repart impart) and then have
> something like: 
> 
> testfun(xx) == 
>     res := TESTFUN(xx :: DoubleFloat)$Lisp
>     complex(float car res, float car cdr res) 
> 
> Presumably I could convert this into Complex(DoubleFloat) within the Lisp code
> directly with some SPADCALL calls? But the current way seems to be perfectly
> fine, but I am wondering if this is the right/recommended way to do it. 
> Overall
> I'm really happy how easy this turned out to be.
> 
> Thanks,
> Tobias
> 
> -- 
> 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
> 

Re: [fricas-devel] New README

2021-04-18 Thread Kurt Pagani



On 18.04.2021 17:34, Ralf Hemmecke wrote:
>> http://www.math.uni.wroc.pl/~hebisch/fricas/README
...
> 
> https://stackoverflow.com/questions/2351190/static-dynamic-vs-strong-weak
> 
> If I look at what they write in the first reference than with our
> "pretend" keyword, SPAD would be weakly typed.
> 

I'm advertising for 'strongly typed'. First of all, we claim it in
https://en.wikipedia.org/wiki/FriCAS and second - following the link:

"""
Generally, a strongly typed language has stricter typing rules at compile time,
which implies that ...
"""

That's just what we find, don't we? Using "pretend" should be last resort.

...
> Ralf
> 

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/9e0a953f-0a9d-3674-99ef-6fbb9eade62a%40gmail.com.


Re: [fricas-devel] Bug in Complex

2021-02-18 Thread Kurt Pagani
Not at all ;) It shows once more that DF ought to have no place in a CAS. DF is
a source of confusion on its own. I'd use Interval(Float) or Float, if need be 
...
BTW 0.5 and 1/2 have different types. The interpreter is sometimes too 
broadminded.


On 19.02.2021 01:17, Tobias Neumann wrote:
> Maybe this is most convincing:
> 
> (3) -> ((-1) :: Complex(DoubleFloat))^(0.5)
> 
>    (3)  6.123233995736766e-17 - %i
>                                                    Type: Complex(DoubleFloat)
> (4) -> ((-1) :: Complex(DoubleFloat))^(1/2)
> 
>    (4)  %i
>                                                    Type: Complex(DoubleFloat)
> 
> I would say that this is undesired behavior and just confuses people.
> 
> -- 
> 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/da5f99f4-3951-4052-9f73-515bb7ef6c66n%40googlegroups.com
> .

-- 
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/edc1bce4-2ca2-beba-9c5e-c8d084f5c08e%40gmail.com.


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

2022-04-21 Thread Kurt Pagani
There is one, however, its underlying Lisp is GCL. Unfortunately jfricas
requires SBCL or another bordeaux threads capable Lisp. Otherwise it works well 
;)

kfp@sirius:~$ apt search fricas
Sorting... Done
Full Text Search... Done
elpa-fricas/impish,impish 1.3.7-1 all
  General purpose computer algebra system: emacs support

fricas/impish,now 1.3.7-1 amd64 [residual-config]
  General purpose computer algebra system: main binary and modules

fricas-databases/impish,impish,now 1.3.7-1 all [installed,auto-removable]
  General purpose computer algebra system: generated text databases

fricas-doc/impish,impish,now 1.3.7-1 all [installed,auto-removable]
  General purpose computer algebra system: documentation

fricas-graphics/impish 1.3.7-1 amd64
  General purpose computer algebra system: graphics subsystem

fricas-graphics-data/impish,impish,now 1.3.7-1 all [installed,auto-removable]
  General purpose computer algebra system: graphics data

fricas-hypertex/impish 1.3.7-1 amd64
  General purpose computer algebra system: hypertex subsystem

fricas-hypertex-data/impish,impish,now 1.3.7-1 all [installed,auto-removable]
  General purpose computer algebra system: hypertex data

fricas-source/impish,impish,now 1.3.7-1 all [installed,auto-removable]
  General purpose computer algebra system: source files

fricas-test/impish,impish 1.3.7-1 all
  General purpose computer algebra system: regression test inputs


Greetings
Kurt



On 21.04.2022 21:10, 'Nasser M. Abbasi' via FriCAS - computer algebra system 
wrote:
> There is not one. At least I have never seen a Debian package for latest 
> Fricas. 
> 
>>apt-cache search --names-only '^fricas*'
>>
> 
> But it is easy enough to build Fricas from source on Ubuntu. 
> 
> Another option, which I used before is to use Arch Linux based distribution. I
> recommend Manjaro. Then you can simply install Fricas 1.3.7 with one click of 
> a
> button, using its GUI installer, since Fricas package exist on AUR for all 
> Arch
> linux based distributions.  It will download it and install for you.
> 
> https://aur.archlinux.org/packages/fricas
> 
> Nasser
> 
> 
> On Wednesday, April 20, 2022 at 10:06:34 AM UTC-5 ra...@hemmecke.org wrote:
> 
> On https://github.com/fricas/fricas/releases/tag/1.3.7
>  I see the source
> distribution of FriCAS.
> 
> Do we have a FriCAS 1.3.7 debian package (using sbcl) for Ubuntu 20.04
> or 18.04?
> 
> Ralf
> 
> -- 
> You received this message because you are subscribed to the Google Groups
> "FriCAS - computer algebra system" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email
> to fricas-devel+unsubscr...@googlegroups.com
> .
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/fricas-devel/fbe621f1-4801-49df-a4bd-33e88d5a2ea6n%40googlegroups.com
> .

-- 
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/79ea2374-b748-09ec-2982-59ff6b70f641%40gmail.com.


[fricas-devel] retract(s) missing ( Internal Error)

2022-04-24 Thread Kurt Pagani
Some code using "retract" breaks since V1.3.7. I couldn't figure out which 
revs might be accountable for. Any clues?

Here a minimal sample:

)abbrev domain TSTXDP TestXDP
TestXDP() : Exports == Implementation where 
  R   ==> Expression Integer
  SYM ==> Symbol  
  XFS  ==> XFreeAlgebra(SYM,R)
  XDP  ==> XDistributedPolynomial(SYM,R)
  --
  Exports == Join( XFS) with
makeIt : SYM -> %
  Implementation == XDP add
Rep := XDP  
makeIt(s:SYM):% == s::Rep

==
V1.3.5
==
; compilation finished in 0:00:00.008

   TestXDP is now explicitly exposed in frame initial 
   TestXDP will be automatically loaded when needed from 
  /Users/kfp/Desktop/work/spad/pform/TSTXDP.NRLIB/TSTXDP

(1) -> )version

Value = "FriCAS 1.3.5 compiled at Mi, 17. Apr 2019 03:15:11"
(1) -> [X,Y,Z] := map(makeIt,[X,Y,Z])

   (1)  [X, Y, Z]
  Type: 
List(TestXDP)
(2) ->  r:=X*Y^2*Z^4

   2 4
   (2)  X Y Z
Type: 
TestXDP
(3) -> TestXDP has RetractableTo FreeMonoid Symbol

   (3)  true
Type: 
Boolean
(4) -> retract r

   2 4
   (4)  X Y Z
 Type: 
FreeMonoid(Symbol)
(5) -> 

==
V1.3.7
==
; compilation finished in 0:00:00.004

   TestXDP is now explicitly exposed in frame frame1
   TestXDP will be automatically loaded when needed from
  /tmp/TSTXDP.NRLIB/TSTXDP

(1) -> )version

Value = "FriCAS 2021-03-06 compiled at Fr 22 Apr 2022 15:24:45 CEST"
(1) -> [X,Y,Z] := map(makeIt,[X,Y,Z])

   (1)  [X, Y, Z]
  Type: 
List(TestXDP)
(2) ->  r:=X*Y^2*Z^4

   2 4
   (2)  X Y Z
Type: 
TestXDP
(3) -> TestXDP has RetractableTo FreeMonoid Symbol

   (3)  true
Type: 
Boolean
(4) ->  retract r
Function:  retractIfCan : % -> Union(FreeMonoid(Symbol),"failed") is 
missing from domain: TestXDP
   Internal Error
   The function retractIfCan with signature
  (Union (FreeMonoid (Symbol)) failed)$ is missing from domain TestXDP

(4) -> )sh TestXDP

...
 retract : % -> FreeMonoid(Symbol) 
 retractIfCan : % -> Union(FreeMonoid(Symbol),"failed")

-- 
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/a8253ad9-30f3-4043-97eb-e1857c92dbd7n%40googlegroups.com.


Re: [fricas-devel] retract(s) missing ( Internal Error)

2022-04-24 Thread Kurt Pagani
On 24.04.2022 17:14, Ralf Hemmecke wrote:
> Hi Kurt,
> 
> You do not need to create a new domain. It also fails to work with XDP in the
> latest master.

I was aware about that, however, the strange thing is that this failed already
in version 1.3.5.


(2) -> [x,y]:=[s::XDistributedPolynomial(Symbol,EXPR INT) for s in [x,y]]

   (2)  [x, y]
   Type: List(XDistributedPolynomial(Symbol,Expression(Integer)))
(3) -> x*y^3

   3
   (3)  x y
 Type: XDistributedPolynomial(Symbol,Expression(Integer))
(4) -> retract %

   >> Error detected within library code:
   FM1.retract impossible

(4) -> )version

Value = "FriCAS 1.3.5 compiled at Mi, 17. Apr 2019 03:15:11"
(4) ->

(4) -> retractIfCan(x*y^5);

Type: Union("failed",...)
(5) -> retractIfCan(x);

Type: Union("failed",...)

> 
> Actually, if I am not wrong than "A has C" only tells you that C is explicitly
> mentioned in the exports of A, but not whether there is an actual 
> implementation
> for C.

Yes, I also think so, however, when it worked, as it certainly did in 1.3.5,
then you wouldn't waste much time ;)

> 
> (1) -> Expression Integer has SemiRing
> 
>    (1)  true
> (2) -> R   ==> Expression Integer
> (3) -> SYM ==> Symbol
> (4) -> XDP  ==> XDistributedPolynomial(SYM,R)
> (5) -> [x::XDP for x in [X,Y,Z]]
> 
>    (5)  [X, Y, Z]
>    Type: List(XDistributedPolynomial(Symbol,Expression(Integer)))
> 
> (6) -> [a,b,c] := [x::XDP for x in [X,Y,Z]]
> 
>    (6)  [X, Y, Z]
>    Type: List(XDistributedPolynomial(Symbol,Expression(Integer)))
> (7) -> a
> 
>    (7)  X
>    Type: XDistributedPolynomial(Symbol,Expression(Integer))
> (8) -> r := a*b^2*c^4
> 
>    2 4
>    (8)  X Y Z
>    Type: XDistributedPolynomial(Symbol,Expression(Integer))
> (9) -> retract r
> Function:  retractIfCan : % -> Union(FreeMonoid(Symbol),"failed") is missing
> from domain: XDistributedPolynomial(Symbol,Expression(Integer))
>    Internal Error
>    The function retractIfCan with signature
>   (Union (FreeMonoid (Symbol)) failed)$ is missing from domain
>   XDistributedPolynomial(Symbol)(Expression (Integer))
> 
> (9) -> R
> 
>    (9)  Expression(Integer)
> 
> (10) -> R has SemiRing
> 
>    (10)  true
> 
> (11) -> XDP has RetractableTo(FreeMonoid SYM)
> 
>    (11)  true
> 
> However, looking down the implementation chain tells me that retract should be
> implemented through FreeModule(R,FreeMonoid SYM). But we have
> 
> (12) -> F := FreeModule(R,FreeMonoid SYM)
> 
>    (12)  FreeModule(Expression(Integer),FreeMonoid(Symbol))
> (13) -> F has RetractableTo(FreeMonoid SYM)
> 
>    (13)  true
> 
> (16) -> s := 'x::Symbol
> 
>    (16)  x
>    Type: Symbol
> (17) -> sf := s :: F
> 
>    (17)  x
>    Type: FreeModule(Expression(Integer),FreeMonoid(Symbol))
> (18) -> retract sf
> 
>    (18)  x
>    Type: FreeMonoid(Symbol)
> 
> So indeed, your detected error is weird.
> In fact, when you enter XDistributedPolynomial into HyperDoc browse, add the
> parameters vl=Symbol and R=Expression Integer, click on Operations and then on
> Implementation, it also tell you that retractIfCan is nowhere implemented.
> 
> My suspicion is that it has something to do with the conditional 
> implementation
> of retract in FreeModule. I faintly remember that I once had a similar issue.
> 
> Looks like someone must use "git bisect run" to find out which commit causes 
> the
> issue.

Thanks!
Kurt
> 
> Ralf
> 
> Ralf
> 

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/4d2496dd-0200-4ac6-8afa-27ed0f9ecf30%40gmail.com.


Re: [fricas-devel] retract(s) missing ( Internal Error)

2022-04-24 Thread Kurt Pagani



On 24.04.2022 17:38, Ralf Hemmecke wrote:
>>> You do not need to create a new domain. It also fails to work with XDP in 
>>> the
>>> latest master.
>>
>> I was aware about that, however, the strange thing is that this failed 
>> already
>> in version 1.3.5.
> 
> Something I don't understand... you claim that retract$TestXDP works in 1.3.5
> although retract in XDP is claimed to be not implemented as you show below. 
> How
> can that be?

That's the question here :) -- a mystery @moment.

> 
> Anyway, for git-bisect it would be good to know FriCAS commit where 
> retract$XDP
> **is** actually working as expected. I guess that fixing XDP will also fix 
> TestXDP.
> 
> Ralf
> 

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/3074030b-0b4b-a899-3d4e-f776efd03192%40gmail.com.


Re: [fricas-devel] texmacs interface

2022-05-15 Thread Kurt Pagani
You're right, there is not much that's not already integrated in TeXmacs. On the
other hand, as a frequent Tm user, I'd suggest to update the folder and even
considering to fill it with useful addons instead ;) There is no doubt, Tm has
dramatically improved in the past years and the fricas interface should not be
left out in the cold. There are interesting features, like serializing and so
on,  which seem unique to me.

On this occasion I suggest to think about the "prompt" and the display of types
- not very nice from an aesthetic point of view. A first step could be to
rewrite the "markers" in the fricas start script, then one could edit various
items more easily:


markers=$(cat << EOF
)lisp (setf |\$ioHook| (lambda (x  args)
   (cond ((eq x '|startPrompt|) (princ (concat (code-char 2) "prompt\#") ))
 ((eq x '|endOfTeXmacsOutput|) (princ (concat (code-char 5) (code-char
10
 ((eq x '|startTeXmacsOutput|) (princ (code-char 2)))
 ((eq x '|startKeyedMsg|)  (princ (concat (code-char 2) "verbatim:")))
 ((eq x '|endOfKeyedMsg|)  (princ (code-char 5)))
 ((eq x '|endOfPrompt|) (princ (code-char 5) ))  )))

EOF
)


So, just as an a example, the user could set some variables to control the
output items mentioned above.

#
cc2="(code-char 2)"
cc5="(code-char 5)"
cc10="(code-char 10)"

#msgbeg="\"html:\""
#msgend="\"\""

msgbeg="\"latex:{}_{textsf{\""
msgend="\"}}\""

markers=$(cat << EOF
)lisp (setf |\$ioHook| (lambda (x  args)
   (cond ((eq x '|startPrompt|) (princ (concat $cc2 "prompt\#")))
 ((eq x '|endOfTeXmacsOutput|) (princ (concat $cc5 $cc10)))
 ((eq x '|startTeXmacsOutput|) (princ $cc2))
 ((eq x '|startKeyedMsg|)  (princ (concat $cc2 $msgbeg)))
 ((eq x '|endOfKeyedMsg|)  (princ (concat $msgend $cc5 $cc10)))
 ((eq x '|endOfPrompt|) (princ $cc5)

EOF
)

##

Obvioulsy, this is not as user friendly as it should be, however, most features
can also be controlled by a spad file.

To bring it back to your question, it's perhaps more favourable to handle these
things outside the fricas distribution (changed my mind during writing ;).

Best regards
Kurt



---
(2) -> )sh TMSPT
 TexmacsSupport is a package constructor
 Abbreviation for TexmacsSupport is TMSPT
 This constructor is exposed in this frame.
--- Operations 

 addDefaultStyle : () -> Void  addStyle : String -> Void
 changeZoomFactor : Float -> Void  clearAllFields : () -> Void
 closeSession : () -> Void command : String -> Void
 createSubsession : () -> Void evaluateAbove : () -> Void
 evaluateAll : () -> Void  evaluateBelow : () -> Void
 evaluateFieldsInOrder : () -> VoidfirstField : () -> Void
 fitAllToScreen : () -> Void   fitToScreen : () -> Void
 fitToScreenHeight : () -> VoidfitToScreenWidth : () -> Void
 foldAllFields : () -> Voidhtml : String -> Void
 inlineImage : String -> Void  input : String -> Void
 insertFieldAbove : () -> Void insertFieldBelow : () -> Void
 insertTextFieldAbove : () -> Void insertTextFieldBelow : () -> Void
 lastField : () -> Voidlatex : String -> Void
 linkImage : String -> VoidmathInput : String -> String
 message : (String, String) -> VoidnextField : () -> Void
 output : String -> Void   previousField : () -> Void
 prompt : String -> Void   ps : String -> Void
 removeBanner : () -> Void removeDefaultStyle : () -> Void
 removeLastField : () -> Void  removeNextField : () -> Void
 removePreviousField : () -> Void  removeStyle : String -> Void
 scheme : String -> Void   sessionEval : () -> Void
 showTimings : () -> Void  splitSession : () -> Void
 tmActive? : () -> Boolean toggleFooter : () -> Void
 toggleFullScreenMode : () -> Void toggleHeader : () -> Void
 toggleMathInput : () -> Void  toggleMathOutput : () -> Void
 toggleMultilineInput : () -> Void toggleTreeOutput : () -> Void
 unfoldAllFields : () -> Void  verbatim : String -> Void
 zoomIn : Float -> VoidzoomOut : Float -> Void
 toggleSchemeTreeOutput : () -> Void

On 15.05.2022 14:59, Ralf Hemmecke wrote:
> I was just wondering whether we still need to have the directory
> contrib/texmacs in the fricas repo. All these files have
> 
> COPYRIGHT   : (C) 1999, 2012  Joris van der Hoeven and Andrey Grozin
> 
> and fall under GPL3+ and FriCAS is not actually distributing them in the 
> binary
> tarballs. I also do not see that the texmacs directory is ever touched during 
> a
> normal build+install of fricas.
> 
> I suggest to remove contrib/texmacs, because they appear in the latest
> distribution of TeXmacs itself.
> 
> 

Re: [fricas-devel] Re: FFI, CFFI, C2FFI, AUTOWRAP

2022-07-05 Thread Kurt Pagani



On 02.07.2022 19:08, Waldek Hebisch wrote:
> On Sat, Jul 02, 2022 at 10:10:11PM +0800, Qian Yun wrote:

...

> 
> What I would like to call:
> - matrix-matrix multiplication from BLAS
> - routines like solve, SVD, eigenvalue decomposition from Lapack
> - multiplication for polys over Z_p
> 
> That is rather small number of routines (of order of 20).  Generating
> signatures for them is not a problem.  What remains to solve:
> - detecting if there is BLAS/Lapack available and if yes in
>   which library (there are few competing BLAS libraries and
>   Lapack may be configured to use any of them).  To make
>   things more "interesting" original BLAS and Lapack interface
>   was in Fortran 77, there are now C wrappers
> - as I mentioned we need to solve problem of transfering data
>   to foreign routines
> 
> As I mentioned for sbcl we can use pinned objects, for Clozure CL
> and Clisp we need copy, for GCL ATM we just pass pointer to C
> side, but this is not guaranteed to work (basically we bet that
> GCL will not run its garbage collector during foreign call, which
> seem to work in current use.  So the remaing part is avalability
> of BLAS/Lapack.  In other words, problem is not FFI itself but
> managing dependencies.  This affects binary distributions
> because BLAS/Lapack tend to use machine specific instructions
> (BLAS using say AVX will fail on machine without AVX instructions).
> 

That sounds interesting.

There is also a very useful fortran to lisp translator (f2cl) available:

https://trac.common-lisp.net/f2cl/
https://trac.common-lisp.net/f2cl/wiki/GettingF2cl
http://quickdocs.org/f2cl/

"""
The easiest way to get F2CL is to use ​Quicklisp. You can just say
(ql:quickload :f2cl)
to get f2cl.
"""

I translated some examples (*)
(https://github.com/nilqed/f2cl/tree/master/packages/) some years ago (e.g.
BLAS) and it worked well, i.e. it seems easier to me to do lisp->spad than
c->spad.

(*) fortran sources partly from netlib.org



-- 
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/89c60e08-48f4-7bd7-ec56-81dc40c25b23%40gmail.com.


Re: [fricas-devel] an interesting bug, regarding sman (low level C stuff)

2022-06-17 Thread Kurt Pagani
On 17.06.2022 14:58, Qian Yun wrote:
> echo 100 | sudo tee /proc/sys/kernel/ns_last_pid
Hi Qian
Indeed!

---
fp@sirius:~$ echo 100 | sudo tee /proc/sys/kernel/ns_last_pid

100

kfp@sirius:~$ fricas

viewman not present, disabling graphics
hypertex  not present, disabling
*** buffer overflow detected ***: terminated
Aborted (core dumped)

kfp@sirius:~$ uname -a
Linux sirius 5.13.0-48-generic #54-Ubuntu SMP Wed Jun 1 20:38:48 UTC 2022 x86_64
x86_64 x86_64 GNU/Linux

kfp@sirius:~$ cat /etc/os-release
PRETTY_NAME="Ubuntu 21.10"
NAME="Ubuntu"
VERSION_ID="21.10"
VERSION="21.10 (Impish Indri)"
VERSION_CODENAME=impish
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/;
SUPPORT_URL="https://help.ubuntu.com/;
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/;
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy;
UBUNTU_CODENAME=impish

-- 
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/b20afdd8-7a57-b9f1-dfaa-b84eb2e1cfe2%40gmail.com.


Re: [fricas-devel] Problem with retract

2022-04-30 Thread Kurt Pagani
Thank you for the detailed explanations. I see the problems and would agree that
keeping retraction to coefficients has priority. In user code one may easily get
along with the current state. In the meantime I've been trying to rewrite some
functions avoiding XDP, i.e. just using Free-Monoid/Module. In the course of
this I found the following peculiarity when using listOfTerms/construct:

R:=EXPR INT
FMR:=FreeModule(R,Symbol)
[a,b,c]:=[s::FMR for s in [a,b,c]]
T:=a+b+c
lT:=listOfTerms T
clT:=concat(lT,lT)
c1:=construct(clT)$FMR
c2:=constructOrdered(clT)$FMR
c1+c2
c1-c2
c1-c1
c1+c1
--- better!
d1:=reduce(_+,[construct([s])$FMR for s in clT])
d1-d1
d1+d1

Apparently it's favourable to construct each term as the single member of a
list, otherwise the collection/simpl procedure seems to be puzzled (like me).
Is this intentional?

On 30.04.2022 01:03, Waldek Hebisch wrote:
> I am looking at problem reported by Kurt Pagani.  Direct reason
> for trouble is that up to 1.3.6  FreeModuleCategory exported
> retraction to base set.  This retraction is no longer present
> in 1.3.7.  FreeModule still has such retraction, but
> XPolynomialRing which inherits implementation from FreeModule
> among other is of category FreeModuleCategory and no longer
> exports this retraction.  XDistributedPolynomial which officially
> exorts 'retract' used to inherit implementation from XPolynomialRing,
> but in 1.3.7 XPolynomialRing has no 'retract' so also
> XDistributedPolynomial has no implemetation of 'retract'.
> 
> At first glance this may look easy to fix.  But there is deeper
> trouble.  Trying to export 'retract' from FreeModuleCategory
> leads to trouble with polynomials.  Reason is easy to see:
> various retractions are distinguished only by target type.
> If we have several retractions with the same target type,
> then overloading does not work (retractions have quite
> different effects, but our overloading machinery gives no way
> to choose right one).  In particular, for univariate polynomials
> NNI is type of exponents, but also legal type for coefficients.
> Worse, NNI is subtype of Integer and our retraction machinery
> assumes that it can use retraction to Integer even when NNI is
> requested.
> 
> Anyway, in general having retraction both to T1 and T2 is unsafe
> unless we are sure that T1 is different than T2.  In case of
> commutative polynomials currently we have retraction to variables
> and retraction to coefficients.  AFAICS this is unsafe, as we can
> form SparseMultivariatePolynomial(Integer, Integer), that
> is Integer may serve both as coefficients and as variables.
> More generally, any ordered commutatitve semiring may serve
> such dual purpose.
> 
> In case of XDistributedPolynomial ATM there is only one exported
> retraction, that is retraction to exponents.  However, is would be
> natural to have retraction to coefficients (such retraction makes
> sense for any algebra with unit).  For XDistributedPolynomial
> this still is safe, as coefficients are required to be a ring
> and exponents are FreeMonoid which is not a ring.  But
> in case of XPolynomialRing in principle coefficients may be
> the same as exponents (both can be a ring), so having two
> retractions is unsafe.
> 
> I admit that ATM I am not sure what to do.  Inside algebra
> probably most sensible solution is to keep retraction from
> polynomials to coefficients (which is very fundamental) and
> avoid use of other retractions.  It is less clear if we
> should keep exporting extra retractions for use in user
> code or ban them as potentially unsafe.
> 

-- 
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/77ce72c1-7348-c875-2660-8462a32c37b3%40gmail.com.


Re: [fricas-devel] write!(f, Integer)

2022-04-13 Thread Kurt Pagani
For instance,

FORMAT('NIL,"~12,'0d",123)$Lisp
 "0123"

s:=s.(1..#s-1) 
s:=string FORMAT('NIL,"~0,20$",123)$Lisp 
"0123" 

https://en.wikipedia.org/wiki/Format_(Common_Lisp)

On Wednesday, 13 April 2022 at 18:47:27 UTC+2 ra...@hemmecke.org wrote:

> On 13.04.22 18:03, Sid Andal wrote:
> > The output file type is for Integers and each solution (hundreds of 
> > thousands of them) is tagged with a six-digit integer identifier for 
> > searching and analysis purposes. Leading zeros allow to distinguish
> > these tags from other integers (the solutions).
>
> Are you sure you want a leading zero as a distinction of the different
> types of solutions?
>
> A little example of input/output would have been very helpful.
>
> > I was thinking about converting the tags with leading zeros into
> > strings, but, then writing them out will be a problem since output
> > file is of type Integer.
>
> Hmmm... first thing that comes to my mind is add 10^50 to your tags and 
> then rely on the fact that a "tag" number starts with "10". ;-)
> Honestly, I find the File(S) feature rather lispy, anyway. It's 
> seamingly not really meant for communication with other programs, but 
> rather with writing out and reading back into FriCAS itself.
>
> But, Kurt has another solution. You can use the function FORMAT from the 
> Lisp that is present underneath FriCAS. That is not a SPAD-only 
> solution, but for your purpose it would probably be the simplest way to 
> achieve your goal.
>
> I leave it to Kurt to post the details.
>
> Ralf
>

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/95135ae4-119b-488d-a73b-3243296b9b14n%40googlegroups.com.


Re: [fricas-devel] Re: upload CI built binaries to nightly release

2022-08-20 Thread Kurt Pagani
A great convenience, +1 :)



On 20.08.2022 14:33, Qian Yun wrote:
> Done, you can see the result at:
> 
> https://github.com/fricas/fricas-nightly-builds
> https://github.com/fricas/fricas-nightly-builds/releases/tag/nightly
> 
> - Qian
> 
> On 8/18/22 18:57, Qian Yun wrote:
>> So this is my CI scripts, comments are welcome.
>>
>> Some comments:
>>
>> 1. You can see the testing nightly builds from
>> https://github.com/oldk1331/fricas/releases
>>
>> 2. It is hardcoded with my username right now, after setting up
>> repos in https://github.com/fricas, this script will be tweaked
>> and pushed to https://github.com/fricas/fricas.
>>
>> 3. I modified the binary filename to contain date so that it
>> is sorted by date in release page.
>>
>> 4. The scripts does not delete old files.  It may require us
>> to manually clean the release page (once a month is enough I think).
>>
>> 5. Failure of uploading will not make the whole script fail.
>>
>> @Rlaf, if you see my private email regrading repo permissions,
>> please reply.
>>
>> - Qian
>>
>> =
>>  - name: Upload to nightly release
>>    if: ${{ github.event_name == 'push' && github.event.ref ==
>> 'refs/heads/master' && github.repository == 'oldk1331/fricas' }}
>>    run: |
>>  export OWNER_REPO=oldk1331/fricas
>>  export RELEASE_ID=`curl
>> https://api.github.com/repos/${OWNER_REPO}/releases/tags/nightly | jq .id`
>>  curl -v -X POST -H "Accept: application/vnd.github+json" -H
>> "Authorization: token ${{ secrets.token }}"
>> "https://uploads.github.com/repos/${OWNER_REPO}/releases/${RELEASE_ID}/assets?name=FriCAS-$(date
>> +%Y-%m-%dT%H.%M)-linux-x86_64-$(echo ${{ github.sha }} | cut -c 1-8).tbz2"
>> --data-binary "@FriCAS-linux-x86_64-${{ github.sha }}.tbz2" -H "Content-Type:
>> application/x-bzip2" || true
>> =
> 

-- 
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/d12b095e-2af4-ae70-e95c-77753a494f41%40gmail.com.


[fricas-devel] Numbers as type parameters

2022-09-01 Thread Kurt Pagani
Problem: when using a type A(p:Polynomial Integer) in another type B, then 
Fricas complains if p is a number (Expression makes no difference). Is 
there any method to tell the compiler that the number (if) is a "Polynomial 
Integer"? I tried out as much as crossed my mind. Any clues highly 
appreciated?

Below is a minimal code sample:

[1] b:=b::B

   (1)  b
  Type: 
B
[2] f b
 
   >> System error:
   The value
  0
is not of type
  CONS

[3] g b

   (3)  OK
 
 Type: A(r)
[4] h b
 
   >> System error:
   The value
  |pretend|
is not of type
  FIXNUM




)abbrev domain ADOM A
A(p:Polynomial Integer) : Exports == Implementation where 
  --p : Polynomial Integer
  BOP ==> BasicOperator 
  Exports == SetCategory with
coerce : Symbol -> %  
  Implementation == BOP add 
Rep := BOP  
coerce(s:Symbol):% == operator s

)abbrev domain BDOM B
B : Exports == Implementation where 
  BOP  ==> BasicOperator
  PINT ==> Polynomial Integer
  Exports == SetCategory with
coerce : Symbol -> % 
f : % -> A(0)
g : % -> A(r)
h : % -> A(2 pretend PINT)
  Implementation == BOP add 
Rep := BOP  
coerce(s:Symbol):% == operator s
NULL:A(0):="NULL"::Symbol::A(0)
TWO:A(2 pretend PINT):="TWO"::Symbol::A(2 pretend PINT)
r:Polynomial Integer
OK:A(r):="OK"::Symbol::A(r)
f x == NULL 
g x == OK
h x == TWO
---

Background:
http://fricas-wiki.math.uni.wroc.pl/DependentTypeTest1

-- 
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/dee3ae65-8ca5-457a-af05-406d8253a872n%40googlegroups.com.


Re: [fricas-devel] Numbers as type parameters

2022-09-01 Thread Kurt Pagani
On 01.09.2022 19:11, Waldek Hebisch wrote:
> On Thu, Sep 01, 2022 at 09:11:33AM -0700, Kurt Pagani wrote:
>> Problem: when using a type A(p:Polynomial Integer) in another type B, then 
...
> 
> ATM I see no chance to make this working.  Let me recall what I wrote
> im March 2021:
> 
> : However, as long as use is strictly at
> : Spad level, types are not used in conditions and
> : parameters are first assigned to variables and
> : only variables are passed to constructors, then arbitrary
> : non-type parameters probably should work (I know of no obstacle
> : to such use).

I had this vaguely in the back of my head, but did not find the page.
Now I can remember that only variables may be passed ... that's why the function
"g" is working.

> 
> You violated one of rules above, namely you are passing nontrivial
> constants directly to constructor.

Yes, indeed :(

> 
> BTW: '2 pretend PINT' is really bad code.  It works only when
> '2@PINT' works and otherwise silently produces wrong result.

I only wanted to build an A(0) type and was surprised by the
 "The value 0 is not of type CONS", so I tried other things (numbers),
which I don't need, actually.

Perhaps I'll find a work-around (quite confident).

Thank you for the quick answer!
Kurt


> 

-- 
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/3d3ecc3a-8df9-4a69-6924-2c314b904ae4%40gmail.com.


Re: [fricas-devel] Numbers as type parameters

2022-09-01 Thread Kurt Pagani
Thanks for this elaborate explanation - a real eye-opener and hint for a 
(pseudo) work-around :)
When we change Impl B to (using _0,_2,...):

  Implementation == BOP add 
Rep := BOP  
coerce(s:Symbol):% == operator s
_0:PINT
_2:PINT
r:Polynomial Integer
NULL:A(_0):="NULL"::Symbol::A(_0)
TWO:A(_2):="TWO"::Symbol::A(_2)
OK:A(r):="OK"::Symbol::A(r)
f x == NULL 
g x == OK
h x == TWO

then it works, suggesting that I should use a type Symbolic(X) which is 
able to handle primitive integer arithmetics, but avoids constants/numbers? 
Let's see.  

   B is now explicitly exposed in frame initial 
   B will be automatically loaded when needed from 
  /Users/kfp/Desktop/work/spad/BDOM.NRLIB/BDOM

[5] b:=b::B

   (5)  b
  Type: 
B
[6] f b

   (6)  NULL
   Type: 
A(0)
[7]  g b

   (7)  OK
   Type: 
A(r)
[8]  h b

   (8)  TWO
   Type: 
A(2)
[9] 

On Thursday, 1 September 2022 at 20:38:20 UTC+2 Waldek Hebisch wrote:

> On Thu, Sep 01, 2022 at 07:32:00PM +0200, Kurt Pagani wrote:
> > On 01.09.2022 19:11, Waldek Hebisch wrote:
> > > On Thu, Sep 01, 2022 at 09:11:33AM -0700, Kurt Pagani wrote:
> > >> Problem: when using a type A(p:Polynomial Integer) in another type B, 
> then 
> > ...
> > > 
> > > ATM I see no chance to make this working. Let me recall what I wrote
> > > im March 2021:
> > > 
> > > : However, as long as use is strictly at
> > > : Spad level, types are not used in conditions and
> > > : parameters are first assigned to variables and
> > > : only variables are passed to constructors, then arbitrary
> > > : non-type parameters probably should work (I know of no obstacle
> > > : to such use).
> > 
> > I had this vaguely in the back of my head, but did not find the page.
> > Now I can remember that only variables may be passed ... that's why the 
> function
> > "g" is working.
>
> I would say "no error is detected", it does not mean int works...
>
> > > You violated one of rules above, namely you are passing nontrivial
> > > constants directly to constructor.
> > 
> > Yes, indeed :(
> > 
> > > 
> > > BTW: '2 pretend PINT' is really bad code. It works only when
> > > '2@PINT' works and otherwise silently produces wrong result.
> > 
> > I only wanted to build an A(0) type and was surprised by the
> > "The value 0 is not of type CONS", so I tried other things (numbers),
> > which I don't need, actually.
>
> If you look at BDOM.NRLIB/index.KAF you will see:
>
> (CATEGORY |domain| (SIGNATURE |coerce| ($ (|Symbol|)))
> (SIGNATURE |f| ((A 0) $)) (SIGNATURE |g| ((A |r|) $))
> (SIGNATURE |h| ((A (|pretend| 2 (|Polynomial| (|Integer|
>
> And this shous explain source of the problem: constants in signatures
> are represented by Lisp expressions directly taken from source.
> Later. the expressions are passed (maybe quoted) to Lisp eval.
>
> So 0 produces Lisp integer 0. But as you can see:
>
> (3) -> PRETTYPRINT(0::Polynomial(Integer))$Lisp
> (0 . 0)
>
> 0 in Polynomial(Integer) is represented by a pair, with first
> element indicating Union branch, in this case base ring R (that
> is Integer), the second element is value in R, this time
> Lisp integer 0.
>
> This is not easy to fix, because at each place in code we need
> to know intended meaning. Namely, one meaning is syntactic,
> the other is actual value in the domain. ATM we have no way
> to represent general domain values in signatures. Stephen
> Watt sayed that during type checking Aldor compares parse
> tree of actual argument with parse tree of formal argument.
> More or less the same holds for Spad compiler. But at runtime
> we need values from the parameter domain. So, compiler
> and intepreted should insert code computing values.
> Unfortunetly this is missing and requires finding all places
> where we need to do this. Additionally, interpreter represents
> things differently than Spad compiler, so we need extra
> work in interpreter.
>
> -- 
> Waldek Hebisch
>

-- 
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/8b4f4a66-8d0a-4011-9132-5cc5db66f268n%40googlegroups.com.


Re: [fricas-devel] FYI, new SQLlite interface to the Independent CAS integration tests available

2022-08-24 Thread Kurt Pagani
That's great! By the way, may I ask how the latex (e.g. column
fricas_anti_in_latex) is generated? By sage or fricas itself?

Greetings
Kurt

On 24.08.2022 11:42, 'Nasser M. Abbasi' via FriCAS - computer algebra system 
wrote:
> FYI posted at https://groups.google.com/g/fricas-devel and 
> https://groups.google.com/g/sci.math.symbolic 
> 
> 
>   
> 
>  
> 
>  
> 
> To make it easier to query the Independent CAS integration tests results,
> there is now an SQLite database which contains all relevant results
> generated during testing.  This is meant to complement the reports
> and the webpages and not replace them.
> 
> The database and the reports were all generated from the same CSV tables
> after running the integration tests. But using the SQL database it
> is much easier to obtain the information needed by issuing SQL commands.
> 
> To use the database requires the free sqlite3 software. There is
> also a free GUI interface.
> 
> There is an initial release of the database now with information how to
> install it and the software needed use it at the above link.
> 
> The database is not fully populated yet, but can be used immediately.
> It will take about another 1-2 weeks. The above page will indicate
> when the database is completed.
> 
> Examples are given on the above page how to use it.
> 
> Any problems/bugs please let me know.
> 
> --Nasser
> 

-- 
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/74071598-d9b2-bcd4-f1c1-12b3a5d1e4e0%40gmail.com.


Re: [fricas-devel] interpret output of the guessing package

2022-08-24 Thread Kurt Pagani



On 24.08.2022 09:42, Ralf Hemmecke wrote:
>> The reason that the innermost terms (i.e., the factors in the product

> 
> Still there is the question, how am I supposed to take the result apart for
> further computation. That should be explained somewhere. You cannot expect 
> your
> users to know how the internals of Expression(Integer) are to be handled.

Not? ;-)

Maybe, most simple:

f.1

   (13)
   s  - 1  p  - 1s  - 1
   n - 18   7 6
--+++-++--+  ++-++
>   | | >  -  | |[f(p ): (p  - 1)f(p ) + p  - 1 = 0] + 2 + 2
--+ | | --+   | |5 55 5
   s  = 0  p  = 0  s  = 0p  = 0
8   7   6 5
Type: Expression(Integer)
g:=f.1::InputForm

   (15)
   (+

 (sum

   (product

 (+

   (sum

 (*  - 1

   (product  (rootOfRec %F (%inforec1))
(equation %F (SEGMENT 0 (+ %G - 1
   )

(equation %G (SEGMENT 0 (+ %H - 1

  2)

(equation %H (SEGMENT 0 (+ %I - 1

  (equation %I (SEGMENT 0 (+ n - 1

2)
  Type: InputForm
car g

   (16)  +
  Type: InputForm
cdr g

   (17)
   (
 (sum

   (product

 (+

   (sum

 (*  - 1

   (product  (rootOfRec %F (%inforec1))
(equation %F (SEGMENT 0 (+ %G - 1
   )

(equation %G (SEGMENT 0 (+ %H - 1

  2)

(equation %H (SEGMENT 0 (+ %I - 1

  (equation %I (SEGMENT 0 (+ n - 1

2)
  Type: InputForm




> 
> Ralf
> 

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/1180786c-c633-fb55-028e-33dcaf2c409e%40gmail.com.


Re: [fricas-devel] FYI, CAS independent integration tests, summer 2022 edition completed

2022-08-21 Thread Kurt Pagani
Hi Nasser
Nice work!
Thanks and best regards
Kurt

p.s.
I'm quite surprised by the Sympy performance.
Not bad (IMO) for a pure Python system :)

On 21.08.2022 08:15, 'Nasser M. Abbasi' via FriCAS - computer algebra system 
wrote:
>  FYI,
> 
> (Posted at https://groups.google.com/g/fricas-devel and 
> https://groups.google.com/g/sci.math.symbolic)
> 
> Independent CAS integration tests summer 2022 edition is now complete.
> (It took about 5 months since I initially started working on it!)
> 
> 
> 
> The following is summary of changes in this version
> compared to last year's edition 
> 
> 1. Number of integrals increased to 85,479 from 71,994.
> 
> The integrals are made of the following 210 files:
> 
> a. Rubi test suite. Files 1 to 208. Thanks to Alert Rich. 
> Downloaded from 
> b. IntegrateAlgebraic test file. File 209. Thanks to Sam Blake.
> c. Fricas test file. File 210. Thanks to Waldek Hebisch.
> 
> 2. CAS version changes: 
> Maple 2021.1 -> 2022.1
> Mathematica 12.3 -> 13.01
> Giac 1.7.0 -> 1.9.0-13 
> Sympy 1.8/python 3.8.8 -> 1.10.1/Python 3.10.4 
> Maxima 5.44 -> 5.46
> FriCAS 1.3.7 -> 1.3.8 
> Sagemath 9.3 -> 9.6
> 
> No version change for Mupad at Matlab 2021a and Rubi at 4.16.1
> but Rubi was run again on the current Mathematica 13.1 version.
> 
> 3. General improvements to Latex and other formatting.
> 
> 4. Flow chart of the test program at
> 
> 
> 5. Links to download all the 85,483 integrals in plain text in 
> Mathematica, Rubi, Maple, Mupad, Sympy, and Sagemath (Fricas, Maxima, Giac) 
> formats are at introduction page of the main page.
> 
> 6. Regression reports comparing results in 2022 edition to 2021 edition
> are also now available. These reports show integrals that failed 
> in current versions compared to last versions per CAS. 
> 
> 
> 
> Regression per CAS
> --
> This table below gives the number of integrals that failed in 
> this test (could be due to timeout, exception or not solved) but 
> are solved in summer 2021 for each CAS.
> 
> Number of regression per CAS is (less is better)
> 
> Fricas: 16
> Maxima: 17
> Mathematica: 98
> Maple: 114
> Giac: 363
> Sympy: 379 
> 
> Tables give details about each integral that failed in regression.
> 
> 7. Sympy, Sagemath (Fricas, Maxima, Giac) were all run on Linux 
> inside Oracle Virtual Box. Maple, Rubi, Mupad and Mathematica were 
> run on windows 10. All on same PC with 128 GB RAM with 
> Intel Core i9-12900K 3.20 GHz.
> 
> RESULTS
> ===
> 
> Overall solved percentage in summer 2022 edition
> =
> 1. Mathematica 13.1 97.99 %
> 2. Rubi 4.16.1 94.21 %
> 3. Maple 2022.1 84.53 %
> 4. Fricas 1.3.8 79.33 %
> 5. Giac 1.9.0-13 58.37 %
> 6. Maxima 5.46 56.86 %
> 7. Mupad 2021a 56.1 %
> 8. Sympy 1.10.1 41.89 %
> 
> Grading results
> =
> Note that mupad is not graded. Default grade of B is given for 
> any passed integral.
> 
> 1. Rubi 91.50 %
> 2. Mathematica 78.58 % 
> 3. Maple 56.34 %
> 4. Fricas 53.78 %
> 5. Maxima 43.57 % 
> 6. Giac 42.36 %
> 7. Sympy 28.49 % 
> 8. Mupad* N/A
> 
> Time and leaf size Performance
> ==
> Sorted by time performance in average time used per integrals (seconds).
> 
> Note for Maple(*) timing: the option method=_RETURNVERBOSE was used 
> which made Maple run through all integration methods increasing 
> average time used. For example in summer 2021 edition which did 
> not use this option, Maple had 0.79 seconds average time on 
> a slower PC also than the one used for the current tests.
> 
> 1. Rubi 0.3 (sec)
> 2. Maxima 0.49 (sec) 
> 3. Giac 0.75 (sec) 
> 4. Fricas 1.17 (sec) 
> 5. Mathematica 2.38 (sec) 
> 6. Mupad 2.75 (sec) 
> 7. Maple* 3.33 (sec) 
> 8. Sympy 5.24 (sec) 
> 
> General notes
> ==
> 1) Maxima, Fricas and Giac were called via Sagemath. Some integrals 
> could have failed due to interface issues. These will have F(-2) 
> error code in the section "Detailed conclusion table per each 
> integral for all CAS systems" per each report and also in the actual 
> integral page with the actual exception name shown. 
> 
> This allows one to see if the cause of the failure is due to 
> interface issue or internal error from the CAS itself. 
> 
> For an example, the integral on
> 
> 
> 
> Has F(-2) on Fricas output, but looking at the exception
> 
> integrate(x*sin(a+b*log(c*x^n))^(1/2),x, algorithm="fricas")
> 
> "Exception raised: TypeError >> Error detected within library code:
> integrate: 

Re: [fricas-devel] is there an official Fricas icon?

2022-08-21 Thread Kurt Pagani
Although I care little about logos, it might be preferable to have one that can
be constructed in a simple way, e.g. as ASCII art or by a LaTeX macro.
There are some tools (figlet for ascii-art) or tizk for LaTeX which may be of
help (see links below).
A quick search and some adjustments resulted in the hints below (which doesn't
mean, I like it ;). Actually I like the one Bill referred to in the last post.



https://en.wikipedia.org/wiki/FIGlet


logo:=[_
"   ",_
"   __     ",_
"  / /__(__) __/ __ | / / ",_
" / __// / / //  |__\ \   ",_
"/__/ /__/ /__/\__/__/ |__/__/   ",_
"=~=~=~=~==~=~=~=~==~=~=~=~=  "]

   (2)

   ["   __", "   _     ",
"  / __/___(_) ___/ _ | / __/ ", " / _// __/ / /__/ __ |_\ \   ",
"/_/ /_/ /_/\___/_/ |_/___/   ", "=~=~=~=~==~=~=~=~==~=~=~=~=  "]
   Type: List(String)
map(output,logo);
  __
  _    
 / __/___(_) ___/ _ | / __/
/ _// __/ / /__/ __ |_\ \
   /_/ /_/ /_/\___/_/ |_/___/
   =~=~=~=~==~=~=~=~==~=~=~=~=

 Type: List(Void)




or in LaTeX:

https://tex.stackexchange.com/questions/381262/logo-design-with-tikz
https://tex.stackexchange.com/questions/297879/drawing-logo-with-tikz
https://tex.stackexchange.com/questions/469279/how-can-i-create-this-logo-in-latex

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{fit}
\usepackage{amssymb}
\begin{document}
\begin{tikzpicture}
\node [yscale=2.8,xscale=1.2,rotate=-5] (int)
{$\int_\mathtt{\partial}^{\mathtt{\aleph_0}}$};
\node (H1) at ([yshift=-1mm,xshift=2mm]int.east) {\textbf{\textsf{CAS}}};
\node (H2) at ([yshift=1mm,xshift=-1mm]int.west) {\textbf{\textsf{Fri}}};
\node[circle,draw,thick,fit=(int) (H1) (H2),inner sep=-4pt]{};
\end{tikzpicture}
\end{document}






On 20.08.2022 21:01, Bill Page wrote:
> From FriCAS wiki
> 
>http://fricas-wiki.math.uni.wroc.pl/FrontPage
> 
> there is a variant of the original Axiom icon.
> 
> On Sat, 20 Aug 2022 at 10:13, Ralf Hemmecke  wrote:
>>
>>  > But what I really think is that a real logo, a figure, a drawing etc.
>>  > should be used with the name of FriCAS (in the logo eventually or
>>  > below).
>>
>> Right.
>>
>> I think we should call for a little competition. ;-)
>> Anyone interested? Let's collect some ideas.
>> See attachment.
>>
>> Ralf
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "FriCAS - computer algebra system" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to fricas-devel+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/fricas-devel/2325fe2c-ea32-d919-c407-55992960ac08%40hemmecke.org.
> 

-- 
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/ef717da8-4465-69a1-2371-69597611a843%40gmail.com.


fricas_logo.pdf
Description: Adobe PDF document


logo:=[_
"   ",_
"   __     ",_
"  / /__(__) __/ __ | / / ",_
" / __// / / //  |__\ \   ",_
"/__/ /__/ /__/\__/__/ |__/__/   ",_
"=~=~=~=~==~=~=~=~==~=~=~=~=  "]

   (2)
   ["   __", "   _     ",
"  / __/___(_) ___/ _ | / __/ ", " / _// __/ / /__/ __ |_\ \   ",
"/_/ /_/ /_/\___/_/ |_/___/   ", "=~=~=~=~==~=~=~=~==~=~=~=~=  "]
   Type: List(String)
map(output,logo);
  __
  _    
 / __/___(_) ___/ _ | / __/
/ _// __/ / /__/ __ |_\ \
   /_/ /_/ /_/\___/_/ |_/___/
   =~=~=~=~==~=~=~=~==~=~=~=~=

 Type: List(Void)
Font: slant
__ _ _   _
   / /(_) /   | / ___/
  / /_  / ___/ / /   / /| | \__ \ 
 / __/ / /  / / /___/ ___ |___/ / 
/_/   /_/  /_/\/_/  |_//  


Font: small
 ____  ___   _   ___ 
| __| _(_)/ __| /_\ / __|
| _| '_| | (__ / _ \\__ \
|_||_| |_|\___/_/ \_\___/

Font: smshadow
 __|   _)  __|   \__|
 _|  _| | ( _ \ \__ \
_| _|  _|\___|_/  _\/
 

Font: smslant
   _    
  / __/___(_) ___/ _ | / __/
 / _// __/ / /__/ __ |_\ \  
/_/ /_/ /_/\___/_/ |_/___/  


Font: standard
 _ _  _  
|  ___| __(_)/ ___|  / \  / ___| 
| |_ | '__| | | / _ \ \___ \ 
|  _|| |  | | |___ / ___ \ ___) |

Re: [fricas-devel] Adding new lisp (ABCL) support

2022-09-19 Thread Kurt Pagani
Hi Qian

I strongly encourage this endeavor :)
ABCL is quite useful when speed is not the top priority. Fricas in a .jar would
be really attractive.

I reported a bug  5 years ago ... but I'm not up to date at the moment.
https://armedbear-devel.common-lisp.narkive.com/Yh8vNHwi/fricas-w-abcl

It works fine with Maxima, especially in combination with the Java based jEdit
editor. Would be great to have something alike for fricas.

https://github.com/nilqed/abcl_maxima
https://github.com/nilqed/abcl-j


On 19.09.2022 16:24, Qian Yun wrote:
> I'd like to add new lisp support for FriCAS soon, starting with ABCL.
> 
> First, ABCL almost supports fricas0, I have identified 2 bugs and they
> are fixed upstream (not merged yet, should be available next release).
> So I think it is time to add ABCL support in FriCAS repo.
> 
> https://github.com/armedbear/abcl/issues/500
> https://github.com/armedbear/abcl/issues/504
> 
> Second, to add ABCL support for FriCAS, I guess it is similar to add
> support for POPLOG?  So basically adding "#+abcl" near "#+poplog".
> 
> Third, if so, I'd like to clean it up a bit before adding ABCL support:
> how about grouping those implementation specific stuff into a single
> place/file?
> 
> - Qian
> 

-- 
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/4829e5cb-77f3-c754-c52c-134e2ddcb8e4%40gmail.com.


Re: [fricas-devel] Adding new lisp (ABCL) support

2022-09-19 Thread Kurt Pagani
This is the official one:
https://abcl.org/

Meta: it is (very briefly) mentioned in 
https://en.wikipedia.org/wiki/Common_Lisp

"""
Freely redistributable implementations
Armed Bear Common Lisp (ABCL)
A CL implementation that runs on the Java Virtual Machine.[23] It includes a
compiler to Java byte code, and allows access to Java libraries from CL. It was
formerly just a component of the Armed Bear J Editor.
"""

On 19.09.2022 18:05, Grégory Vanuxem wrote:
> I wonder always : a link to ABCL?
> Am not a fan of « Google is your friend » but yes I can find some
> information.
> 
> But, for sure, it’s a good idea and can ameliorate the stuff.
> __
> Greg
> 
> Le lun. 19 sept. 2022 à 16:24, Qian Yun  a écrit :
> 
>> I'd like to add new lisp support for FriCAS soon, starting with ABCL.
>>
>> First, ABCL almost supports fricas0, I have identified 2 bugs and they
>> are fixed upstream (not merged yet, should be available next release).
>> So I think it is time to add ABCL support in FriCAS repo.
>>
>> https://github.com/armedbear/abcl/issues/500
>> https://github.com/armedbear/abcl/issues/504
>>
>> Second, to add ABCL support for FriCAS, I guess it is similar to add
>> support for POPLOG?  So basically adding "#+abcl" near "#+poplog".
>>
>> Third, if so, I'd like to clean it up a bit before adding ABCL support:
>> how about grouping those implementation specific stuff into a single
>> place/file?
>>
>> - Qian
>>
>> --
>> 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/87df413f-02a0-76ca-ce0c-9e27c36e1507%40gmail.com
>> .
>>
> 

-- 
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/c1a041f1-b501-c3bd-8102-11d9ed5d2dd8%40gmail.com.


Re: [fricas-devel] FYI, new SQLlite interface to the Independent CAS integration tests available

2022-09-22 Thread Kurt Pagani

Hi Nasser

Cool, thanks.

BTW1:  slipped into your last link ;)
https://12000.org/my_notes/CAS_integration_tests/reports/summer_2022/DATA_BASE/index.htm

BTW2: there is a sqlite interface to CL: 
https://cl-sqlite.common-lisp.dev/#installation, i.e. the db can be used in 
fricas/quicklisp as well.


On 22.09.2022 13:37, 'Nasser M. Abbasi' via FriCAS - computer algebra system 
wrote:

Fyi,

CAS integrations tests SQL database is now fully build.

<http://localhost/my_notes/CAS_integration_tests/reports/summer_2022/DATA_BASE/index.htm>

After extracting the zip file, the size of the db is 1.3 GB.

Added lots of examples also.  Here are few related to Fricas

Find how many problem Fricas uses Weierstrass special functions in its
solution

sqlite>select COUNT(*) from main where fricas_anti LIKE '%weierstrass%';
  4066

sqlite> select COUNT(*) from main where fricas_anti LIKE '%fresnel_sin%'
OR'%fresnel_cos%';
   395

Find how many problems Fricas solved
sqlite>  SELECT COUNT(*) from main where fricas_pass=1;
64582

Total number of intergrals

sqlite> select COUNT(*) from main;
85479


--Nasser


On Wednesday, August 24, 2022 at 10:47:24 AM UTC-5 Nasser M. Abbasi wrote:


Hello Kurt;

The latex for Fricas and Maxima and Giac is all generated by sagemath
itself. After the call from integrate returns, the test program does

anti_in_latex = latex(anti)

In the sagemath/python script. Also the grading is done in the same Python
script, all inside sagemath.

--Nasser


On Wednesday, August 24, 2022 at 7:54:39 AM UTC-5 Kurt Pagani wrote:


That's great! By the way, may I ask how the latex (e.g. column
fricas_anti_in_latex) is generated? By sage or fricas itself?

Greetings
Kurt

On 24.08.2022 11:42, 'Nasser M. Abbasi' via FriCAS - computer algebra
system wrote:

FYI posted at https://groups.google.com/g/fricas-devel and
https://groups.google.com/g/sci.math.symbolic



<

https://12000.org/my_notes/CAS_integration_tests/reports/summer_2022/DATA_BASE/index.htm>


<

https://12000.org/my_notes/CAS_integration_tests/reports/summer_2022/DATA_BASE/index.htm




To make it easier to query the Independent CAS integration tests

results,

there is now an SQLite database which contains all relevant results
generated during testing. This is meant to complement the reports
and the webpages and not replace them.

The database and the reports were all generated from the same CSV tables
after running the integration tests. But using the SQL database it
is much easier to obtain the information needed by issuing SQL commands.

To use the database requires the free sqlite3 software. There is
also a free GUI interface.

There is an initial release of the database now with information how to
install it and the software needed use it at the above link.

The database is not fully populated yet, but can be used immediately.
It will take about another 1-2 weeks. The above page will indicate
when the database is completed.

Examples are given on the above page how to use it.

Any problems/bugs please let me know.

--Nasser









--
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/d328f954-8016-32f0-3fd4-829373eeebae%40gmail.com.


Re: [fricas-devel] FYI, new SQLlite interface to the Independent CAS integration tests available

2022-09-22 Thread Kurt Pagani

Addendum: forgot adding the example   works well despite the 1.2 GB size 
now!

(ql:quickload :sqlite)
(use-package :sqlite)
(defvar *db* (connect "/home/kfp/Desktop/cas_integration_tests.db"))
*DB*
(execute-single *db* "select COUNT(*) from main where fricas_anti LIKE 
'%weierstrass%'")

4054
(execute-single *db* "select COUNT(*) from main where fricas_anti LIKE 
'%fresnel_sin%'

OR'%fresnel_cos%'")
395
(execute-to-list *db* "select fricas_anti from main limit 10")

(("1/3*(2*x + 1)^(3/2)") ("2/135*(27*x^2 + 3*x - 2)*sqrt(3*x + 1)")

 ("2/105*(15*x^3 + 3*x^2 - 4*x + 8)*sqrt(x + 1)")

 ("-2/27*(3*x + 4)*sqrt(-3*x + 2)") ("-1/4/(x^4 + 4*x^3 + 8*x^2 + 8*x + 4)")

 ("1/3*cos(x)^3 - cos(x)") ("3/28*(4*z^2 - z - 3)*(z - 1)^(1/3)")

 ("1/2/(cos(x)^2 - 1)") ("1/3*(sin(2*x) - 4)*sqrt(-sin(2*x) + 4)")

 ("1/(cos(x) + 3)"))

*

On 22.09.2022 13:37, 'Nasser M. Abbasi' via FriCAS - computer algebra system 
wrote:

Fyi,

CAS integrations tests SQL database is now fully build.

<http://localhost/my_notes/CAS_integration_tests/reports/summer_2022/DATA_BASE/index.htm>

After extracting the zip file, the size of the db is 1.3 GB.

Added lots of examples also.  Here are few related to Fricas

Find how many problem Fricas uses Weierstrass special functions in its
solution

sqlite>select COUNT(*) from main where fricas_anti LIKE '%weierstrass%';
  4066

sqlite> select COUNT(*) from main where fricas_anti LIKE '%fresnel_sin%'
OR'%fresnel_cos%';
   395

Find how many problems Fricas solved
sqlite>  SELECT COUNT(*) from main where fricas_pass=1;
64582

Total number of intergrals

sqlite> select COUNT(*) from main;
85479


--Nasser


On Wednesday, August 24, 2022 at 10:47:24 AM UTC-5 Nasser M. Abbasi wrote:


Hello Kurt;

The latex for Fricas and Maxima and Giac is all generated by sagemath
itself. After the call from integrate returns, the test program does

anti_in_latex = latex(anti)

In the sagemath/python script. Also the grading is done in the same Python
script, all inside sagemath.

--Nasser


On Wednesday, August 24, 2022 at 7:54:39 AM UTC-5 Kurt Pagani wrote:


That's great! By the way, may I ask how the latex (e.g. column
fricas_anti_in_latex) is generated? By sage or fricas itself?

Greetings
Kurt

On 24.08.2022 11:42, 'Nasser M. Abbasi' via FriCAS - computer algebra
system wrote:

FYI posted at https://groups.google.com/g/fricas-devel and
https://groups.google.com/g/sci.math.symbolic



<

https://12000.org/my_notes/CAS_integration_tests/reports/summer_2022/DATA_BASE/index.htm>


<

https://12000.org/my_notes/CAS_integration_tests/reports/summer_2022/DATA_BASE/index.htm




To make it easier to query the Independent CAS integration tests

results,

there is now an SQLite database which contains all relevant results
generated during testing. This is meant to complement the reports
and the webpages and not replace them.

The database and the reports were all generated from the same CSV tables
after running the integration tests. But using the SQL database it
is much easier to obtain the information needed by issuing SQL commands.

To use the database requires the free sqlite3 software. There is
also a free GUI interface.

There is an initial release of the database now with information how to
install it and the software needed use it at the above link.

The database is not fully populated yet, but can be used immediately.
It will take about another 1-2 weeks. The above page will indicate
when the database is completed.

Examples are given on the above page how to use it.

Any problems/bugs please let me know.

--Nasser









--
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/1fb46b37-ec72-3f7b-f7f8-e2fda9fc42a5%40gmail.com.


Re: [fricas-devel] Re: thoughts on SparseUnivariatePolynomial multiplication

2022-10-02 Thread Kurt Pagani

On 02.10.2022 12:37, Qian Yun wrote:



On 10/2/22 13:18, Qian Yun wrote:

So first conclusion is to optimize for small inputs.  There's not much
room for it, I think.

For bigger inputs, I think current implementation is bad both ways:

a) For sparse cases, simply chain the MxN terms together, sort and
dedupe is O(N^2*log(N)) better than current O(N^3).

b) For dense cases, using actual dense representation like array
should be a great improvement over current implementation:
we only need a (slightly larger than) (M+N) length array to store
the temp result.


No need to create an array to store temp result, we only need to
create array for input (p, q) and the coefficient of (p * q) can
be computed directly, for example:

https://github.com/sympy/sympy/blob/sympy-1.11.1/sympy/polys/densearith.py#L735

I think this will be valid optimization for small (but dense)
inputs as well.  Will need data to determine when to use this
method -- what qualifies a polynomial as "dense"?
For example, max degree - min degree < 2 * number of monomials ?


A good question. I've never seen a satisfactory definition. While some think of
(https://math.berkeley.edu/~bernd/cbms.pdf)

"""
Here and throughout this book, a polynomial is called sparse if we know a priori 
which monomials appear with non-zero coefficients in that polynomial.

"""

it may well make sense to distinguish sparse/dense:

What Can (and Can’t) we Do with Sparse Polynomials?
https://arxiv.org/pdf/1807.08289.pdf
https://www.usna.edu/Users/cs/roche/research/phd/



- Qian



--
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/5f7bdd45-fcc4-2eb5-9bb9-b88f1f554d48%40gmail.com.


Re: [fricas-devel] definite integral

2022-09-05 Thread Kurt Pagani
I guess the problem is limit(Ei(-x),x=%plusInfinity) --> failed

https://en.wikipedia.org/wiki/Exponential_integral

Even with c:=1:

I:=integrate(exp(-x)*log(x),x=eps..1/eps,"noPole")

 1
  - ---
   - eps   2eps  1 1
 %e log(eps ) - %e log() + 2 Ei(- ---) - 2 Ei(- eps)
  2   eps
   eps
   (1)  ---
2
  Type: Union(f1: OrderedCompletion(Expression(Integer)),...)
limit(%,eps,0)


limit(%,eps=0)

   (42)  [leftHandLimit = - infinity, rightHandLimit = "failed"]
Type: Union(Record(leftHandLimit:
Union(OrderedCompletion(Expression(Integer)),"failed"),rightHandLimit:
Union(OrderedCompletion(Expression(Integer)),"failed")),...)

So the MM/M-results are not better.


On 05.09.2022 14:48, Ralf Hemmecke wrote:
> Consider c>0.
> 
> (1) -> integrate(exp(-c*x)*log(x),x=0..%plusInfinity)
> 
>    (1)  "faileed"
> 
> Can FriCAS specify "c>0" somehow?
> 
> In Mathematica I get.
> 
> In[1]:= Integrate[Exp[-c*x]*Log[x], {x, 0, Infinity}]
> 
> Out[1]= ConditionalExpression[-((EulerGamma + Log[c])/c), Re[c] > 0]
> 
> In Maple I get at least...
> 
>> integrate(exp(-c*x)*log(x),x=0..infinity);
> 
>   exp(-c x) ln(x) + ln(c) + Ei(1, c x) + gamma
>   lim   - 
>  x -> infinity c
> 
> Since we do not have "lim" in OutputForm, it would be hard to return a result
> similar to Maple.
> 
> Ralf
> 


I:=integrate(exp(-c*x)*log(x),x=eps..1/eps,"noPole")

   c
- ---
   - c eps   2eps  1 c
 %e   log(eps ) - %e log() + 2 Ei(- ---) - 2 Ei(- c eps)
2   eps
 eps
   (1)  ---
 2 c
  Type: Union(f1: OrderedCompletion(Expression(Integer)),...)



I.f1

   c
- ---
   - c eps   2eps  1 c
 %e   log(eps ) - %e log() + 2 Ei(- ---) - 2 Ei(- c eps)
2   eps
 eps
   (2)  ---
 2 c
 Type: OrderedCompletion(Expression(Integer))


limit(I.f1,eps=0)

   (3)  "failed"
Type: Union("failed",...)




Using c^2 instead of c =>

limit(I.f1,eps=0)

   (22)  [leftHandLimit = - infinity, rightHandLimit = "failed"]
Type: Union(Record(leftHandLimit:
Union(OrderedCompletion(Expression(Integer)),"failed"),rightHandLimit:
Union(OrderedCompletion(Expression(Integer)),"failed")),...)


J:=integrate(exp(-c^2*x)*log(x),x)

2
 - c x   2
 - %e log(x) + Ei(- c x)
   (24)  ---
   2
  c
 Type: Union(Expression(Integer),...)

limit(J,x=0)

   (27)
 2
log(c ) - log(- 1) - digamma(1)
   [leftHandLimit = ---, rightHandLimit = "failed"]
2
   c
Type: Union(Record(leftHandLimit:
Union(OrderedCompletion(Expression(Integer)),"failed"),rightHandLimit:
Union(OrderedCompletion(Expression(Integer)),"failed")),...)

limit(J,x=%plusInfinity)

   (34)  "failed"
Type: Union("failed",...)


limit(Ei(-x),x=%plusInfinity)

   (37)  "failed"
Type: Union("failed",...)

-- 
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/e1deb241-ba32-dd91-c566-b6a910e9a2c2%40gmail.com.


Re: [fricas-devel] How one talk to sqlite3 database from Fricas?

2024-04-11 Thread Kurt Pagani
https://github.com/nilqed/spadlib/tree/master/sqlite


'Nasser M. Abbasi' via FriCAS - computer algebra system <
fricas-devel@googlegroups.com> schrieb am So., 24. Dez. 2023, 03:53:

> I googled and could not find hit on this. Is it possible to open SQLITE3
>  database file from Fricas and
> read/write to the database using SQL?
>
> Currently all my integration problems are stored in sqlite3 database which
> is open source database. Both Maple and Mathematica support reading/write
> to it. I wrote small note sometime ago how to do this in Maple. Here is
> link 
>
> Does Fricas have such API?  I use sqlite3 for all my software and store
> everything in database files.
>
> Thanks
> --Nasser
>
> --
> 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/31dff7b9-5745-491e-95f3-90ed3d2fe949n%40googlegroups.com
> 
> .
>

-- 
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/CA%2BTGnoZDbhnyB7nSKbB-yxb9-KkO%2BJA3h-U0Lk5XjveYbCsZoA%40mail.gmail.com.


<    1   2   3   4