Re: [fricas-devel] )trace )stats reset -- abort s xx.input?

2018-07-17 Thread Waldek Hebisch
Raymond Rogers wrote:
> 
> Found the call to UNTRACE-2
> Overall examining make.lst is pretty depressing.  If nobody is going to 
> fix (or explain) this then I will try another lisp.

Here you see "impedance mismatch".  In Lisp undefined functions
and (global) variables are legal -- the assumption is that
programmer will define them as needed.  Since they frequently
are errors sbcl (and probably other Lisps) warn about them.
However, Lisp do not have declaration as other languages
(Lisp "declarations" do different thing than one expects
from declarations) and I am not aware of any way to tell
Lisp compiler that function is expected to be defined
without defining it.  And similarly for variables.
Consequently, warnings from Lisp do not distinguish
between functions that are not defined at all
and functions that are not defined at point of use
but are defined later.  In practice almost all
warnings about undefined functions are spurious.
But _some_ warnings from sbcl proved to be quite
useful so I do not want to supress _all_ warnings.

More generaly, we get a lot of messages during build,
many of them spurious.  I tried to trim them, but
in general it is hard to remove noise without
removing signal.  As long as there is a lot of
noise one have to search (say using grep) for
useful info, so there is little gain from removing
only part of noise.  And even spurious error
messages sometimes give useful hints (just do
not take them at face value).


-- 
  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 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] )trace )stats reset -- abort s xx.input?

2018-07-17 Thread Waldek Hebisch
Bill Page wrote:
> 
> On Sun, Jul 15, 2018 at 6:37 PM, Bill Page  wrote:
> >
> > It seems that UNTRACE-2 was replaced by untrace2 in this commit
> >
> > https://github.com/fricas/fricas/commit/546108f1b65acadc38fc7d243b1b29770b6a770a
> >
> > https://github.com/fricas/fricas/blame/546108f1b65acadc38fc7d243b1b29770b6a770a/src/interp/trace.boot#L387
> >
> > but apparently this reference to UNTRACE-2 was missed.
> >
> >
> > On Sun, Jul 15, 2018 at 5:31 PM, Raymond Rogers 
> >  wrote:
> >>
> >> Found the call to UNTRACE-2
> >> Overall examining make.lst is pretty depressing.  If nobody is going to 
> >> fix (or explain) this then I will try  another lisp.
> 
> I don't think there is anything wrong with your lisp or with your
> compiled version of FriCAS.
> 
> Here is a patch for the UNTRACE-2 problem:
> 
> --
> 
> diff --git a/src/interp/slam.boot b/src/interp/slam.boot
> index 3787ae0d..26208d5b 100644
> --- a/src/interp/slam.boot
> +++ b/src/interp/slam.boot
> @@ -288,7 +288,7 @@ mkCacheVec(op,nam,kind,resetCode,countCode) ==
>  clearCache x ==
>get(x,'localModemap,$e) or get(x,'mapBody,$e) =>
>  for [map,:sub] in $mapSubNameAlist repeat
> -  map=x => _/UNTRACE_-2(sub,NIL)
> +  map=x => untrace2(sub,[])
>  $e:= putHist(x,'localModemap,nil,$e)
>  $e:= putHist(x,'mapBody,nil,$e)
>  $e:= putHist(x,'localVars,nil,$e)
> 
> --

Good catch, please commit.
 
-- 
  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 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: Error detected within library code:, index out

2018-07-17 Thread Waldek Hebisch
Kurt Pagani wrote:
> 
> Hello Ric
> 
> Thanks for concerning yourself with this, it might be helpful indeed.
> 
> When slightly extending it's even worse ... strange ;)
> I'd expect that u()$SI worked?
> 
> ---
> 
> a) PhysicalUnit() : Category == SetCategory  with  -- inherit from SETCAT
> b) baseUnits() == [x::% for x in enumerate$OrderedVariableList(u)]
> 
> (2) -> b:=baseUnits()$PUSYS(['a,'b,'c])
> 
>(2)  [a,b,c]
>   Type: List(PhysicalUnitSystem([a,b,c]))
> 
> (3) -> )sh 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
> 
> (3) -> u()$SI
> 
> 
>>> Error detected within library code:
>index out of range
> 

The error happens during printing of type.  The following works:

(1) -> u()$SI; 1

   (1)  1
Type: PositiveInteger

Normal way to debug such problems is to use Lisp debugger, see
doc/debug.txt in the trunk.

-- 
  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 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] interoperability with sage again

2018-07-17 Thread Waldek Hebisch
Martin R wrote:
> 
> I am sorry it took so long.  Attached there is a patch which appears to 
> work well:
> 
> (1) -> (3^2)$OUTFORM
> 
>  2
>(1)  3
>  Type: 
> OutputForm
> (2) -> (3^2)$OUTFORM::INFORM
> 
>(2)  '(^ 3 2)
>   Type: 
> InputForm
> (3) -> interpret((3^2)$OUTFORM::INFORM)
> 
>  2
>(3)  3
>  Type: 
> OutputForm

That is OK.  But AFAICS with your code we depend on quote giving
us the right type.  But it seems that this is not always so:

(11) -> interpret((1::OUTFORM)::INFORM)

   (11)  1
Type: PositiveInteger
(16) -> atType((1::OUTFORM)::INFORM)$InputFormFunctions1(OUTFORM)

   (16)  (@ '1 (OutputForm))
  Type: InputForm
(17) -> interpret(atType((1::OUTFORM)::INFORM)$InputFormFunctions1(OUTFORM))
 
   An expression involving @ OutputForm actually evaluated to one of 
  type PositiveInteger . Perhaps you should use :: OutputForm .

Worse, for strings we get wrong value:

(22) -> interpret(("x"::OUTFORM)::INFORM)

   (22)  ""x""
 Type: String

This is because coercion from strings to OutputForm adds quotes.

So minimally, one must special case coercion of OutputForm
consisting from single string.

-- 
  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 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] GPGPU acceleration based on OpenCL?

2018-07-17 Thread Waldek Hebisch
Foad S Farimani wrote:
> 
> I was wondering if there are any plans/attempts to get GPU acceleration for 
> numerical calculations on FriCAS? OpenCL would be the best API as it is 
> cross platform and vendor natural. 

There were some speculations but AFAIK no serious plans or attempts.
Note that GPU acceleration is most useful for special "computational
kernels".  Notable example is linear algebra -- for linear algebra
the simplest way to get GPU acceleration is probably to call
extermal library using GPU acceleration.  The similar thing
is likely for other numeric kernels.

-- 
  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 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: TEXmacs as interface

2018-07-17 Thread Slawomir Kolodynski
Indeed, installing TEXmacs 1.99.7 fixed the problems.

Thank you all for help

Slawomir


On Monday, July 16, 2018 at 3:59:28 AM UTC+2, oldk1331 wrote:
>
> Hi Slawomir, 
>
> TeXmacs 1.0.7.18 was released 5 years ago, you should try more recent 
> version, like 1.99.7. 
>

-- 
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: Error detected within library code:, index out of range

2018-07-17 Thread Kurt Pagani
Hello Ric

Thanks for concerning yourself with this, it might be helpful indeed.

When slightly extending it's even worse ... strange ;)
I'd expect that u()$SI worked?

---

a) PhysicalUnit() : Category == SetCategory  with  -- inherit from SETCAT
b) baseUnits() == [x::% for x in enumerate$OrderedVariableList(u)]

(2) -> b:=baseUnits()$PUSYS(['a,'b,'c])

   (2)  [a,b,c]
  Type: List(PhysicalUnitSystem([a,b,c]))

(3) -> )sh 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

(3) -> u()$SI


   >> Error detected within library code:
   index out of range


On 17.07.2018 16:47, Riccardo GUIDA wrote:
> 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.

I guess this is of no importance w.r.t. to the error (but I may be mistaken)

> 
> Hope not increasing the confusion 

Not at all.
Kurt

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


Version-2-- [fricas-devel] )trace )stats reset -- abort s xx.input?

2018-07-17 Thread Raymond Rogers
I found the particular trace sequence that aborts the calling script.  
Is this expected?

)r test-1.input
Notice that all goes well until line 15; where I try to reset the 
"stats".  Which happens.

But the following code (i.e. the reading of test-1.input is aborted.
Not even hidden; after the stoppage ask:
aa
)trace
the results are in the test.log file.  So the trace is still running as 
is the )spool; but test.input has stopped being read.


Ray


--
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.
)clear all
)system rm test.log
)spool test.log
)r trace_reset
-- prime the pump
test_sub(1)
--
--
-- Start tracing
)trace test_sub )count )time )only a
-- Execute
test_sub(2)
test_sub(3)
-- Stats 
)trace )stats
)trace )stats reset
-- But the next line (and this one) doesn't get executed
aa:=5
test_sub(4)
--
-- 

output("passed")
)spool
output("hi there")

test_sub(p) ==  
output("testing test_sub")
p^2

--
facc(n) == if n < 3 then n else n * facc (n - 1)





)r trace_reset
 
output("hi there")
 
   hi there
   Type: Void

test_sub(p) ==   
output("testing test_sub")
p^2
 
   Type: Void

--
facc(n) == if n < 3 then n else n * facc (n - 1)
 
   Type: Void
-- prime the pump
test_sub(1)
 
   Compiling function test_sub with type PositiveInteger -> 
  PositiveInteger 
   testing test_sub

   (4)  1
Type: PositiveInteger
--
--
-- Start tracing
)trace test_sub )count )time )only a
 
 
   Function traced: test_sub 
-- Execute
test_sub(2)
 
   testing test_sub

   (5)  4
Type: PositiveInteger
test_sub(3)
 
   testing test_sub

   (6)  9
Type: PositiveInteger
-- Stats 
)trace )stats
 
- Traced function execution times --
   *1;test_sub;1;frame1 : 0.0 sec.
 
- Traced function execution counts -
   *1;test_sub;1;frame1 : 2 times
 
   Function traced: test_sub 
)trace )stats reset
 
 
   Trace facility timers, space counts and execution counts have been 
  reset.

(7) -> aa

   (7)  aa
   Type: Variable(aa)
(8) -> )trace
 
   Function traced: test_sub 
(8) -> )trace )stats
- Traced function execution times --
   *1;test_sub;1;frame1 : 0.0 sec.
 
- Traced function execution counts -
   *1;test_sub;1;frame1 : 0 times
 
   Function traced: test_sub 
(8) -> 

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