[fricas-devel] Fwd: X11 und Macbook

2021-10-08 Thread Prof. Dr. Johannes Grabmeier privat

Dear all,

all of a sudden my FriCAS does no longer connect to X11. I installed
XQuartz (again), but same effect, any ideas/help what to do?


Checking for foreign routines
FRICAS="/usr/local/lib/fricas/target/x86_64-apple-darwin17.7.0"
spad-lib="/usr/local/lib/fricas/target/x86_64-apple-darwin17.7.0/lib/libspad.so"
foreign routines found
openServer result 0
   FriCAS Computer Algebra System
    Version: FriCAS 1.3.6
   Timestamp: Fr 27 Mär 2020 21:47:53 CET
-
   Issue )copyright to view copyright notices.
   Issue )summary for a summary of useful system commands.
   Issue )quit to leave FriCAS and return to shell.
-


 
Type: Void

(1) -> (HyperDoc) Cannot connect to the X11 server!
(1) ->

-- 
Mit freundlichen Grüßen
Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Studiengangskoordinator des Masterstudiengangs Wirtschaftsinformatik
Vorsitzender der Prüfungskommission Wirtschaftsinformatik / Künstliche 
Intelligenz
Vorsitzender der Prüfungskommission Angewandte Informatik / Interaktive Systeme 
/ Cyber Security, Life Science Informatics

THD Technische Hochschule Deggendorf
Dieter-Görlitz-Platz 1, D-94469 Deggendorf, Raum K205

Tel. +49-(0)-991-3615-141, Sekr. -332, -764
Fax: +49-(0)-991-3615-199


-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-991-2979592

-- 
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/ee4c893c-1d37-1633-e97b-381b3a491963%40grabmeier.net.


[fricas-devel] inverting matrixes over rings

2021-04-13 Thread Prof. Dr. Johannes Grabmeier privat
the FriCAS code for inverting matrices over R is not correct. If wished
I can provide the necessary changes to matfuns.spad

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


-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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/61f10367-092c-37b3-4837-4cbfc369f18b%40grabmeier.net.


[fricas-devel] floor/ceiling, ^, Syntax for categories with "with"

2021-01-07 Thread Prof. Dr. Johannes Grabmeier privat
Dear all,

writing code for apportionment methods (election, votes and seats) I
heavily need floor and ceiling: % -> Integer - the code should work for
Fraction Integer, DecimalExpansion and Floats

However, the two method in Float have signatures floor, ceiling: % -> %
(should be unified to have function name overloading).
One way out is to define a ExtendedFloat (EFLOAT) with these 2
signatures added, which I did

and having the following conditional code for a package parametrized by
a field K:

if K has with (floor: K -> Integer; ceiling: K -> Integer)

It then works, but in the interpreter I get an error for this:

(297) -> EFLOAT has with (floor: % -> Integer; ceiling: % -> Integer)
   Internal Error
   Unexpected error in call to system function pf2Sex1


Questions to syntax variations of this:

It also compiles if one drops the "with"

if K has with (floor: K -> Integer; ceiling: K -> Integer)

Can someone give a detailed description of the syntax and semantics of
"with"?


Things becomes more complicated using infix functions, which I also have
to use:

if K has with ("^": (K, Fraction Integer) -> K) then

The following behaviour is surprising: I extended Fraction Integer do
ExtendedFraction Integer to include such an approximating powering also
for the rational numbers. Then my package with parameter K = Extended
Fraction Integer recognizes the signatures defined under this condition.
However, the normal Float, which has such a signature implemented in the
system is not recognized. Mysterious.

Testing in the interpreter fails using "with"

(301) -> Float has with ("^": (%, Fraction Integer) -> %)

  Line   1: Float has with ("^": (%, Fraction Integer) -> %)
   ...AB
  Error  A: Missing mate.
  Error  B: syntax error at top level
  Error  B: Possibly missing a )
   3 error(s) parsing

(301) -> Float has with (^: (%, Fraction Integer) -> %)

   Internal Error
   Unexpected error in call to system function pf2Sex1

(301) -> Float has with (_^: (%, Fraction Integer) -> %)

   Internal Error
   Unexpected error in call to system function pf2Sex1


However it works (partially) without the "with":


(302) -> Float has  (_^: (%, Fraction Integer) -> %)

   (302)  true

  
Type: Boolean


Time: 0 sec
(303) -> Float has  ("^": (%, Fraction Integer) -> %)

   (303)  false

  
Type: Boolean
 
Time: 0.04 (OT) = 0.04 sec
(304) -> Float has  (^: (%, Fraction Integer) -> %)

   (304)  true


Can one unify Interpreter and Compiler and communicate clear (and unique
rules) for infix functions and escaping?



-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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/37096524-0ca0-adaa-ba39-da6301796b8c%40grabmeier.net.


Re: [fricas-devel] The function BOOT::PAIR is undefined.

2020-10-17 Thread Prof. Dr. Johannes Grabmeier privat
Thanks Ralf for this hint. Indeed, I had some domains from an older
version around which caused the error.

Am 16.10.20 um 22:03 schrieb Ralf Hemmecke:
> Looks like 'pair' was renamed in this commit on 09-February-2020.
>
> https://github.com/fricas/fricas/commit/97141c6f61a07f1d9484745d7f4051a2caeb7148#diff-0c18939820a0db36a38e0c1b54eb94120dba864e05c18723c90cb3ae621ac7d8L461
>
> However, I wonder how you can get this error if 'pair' is actually not
> in FriCAS. Sounds like you are using old and new code together. (?)
>
> Ralf
>
> On 10/16/20 9:12 PM, Prof. Dr. Johannes Grabmeier privat wrote:
>> Hi all,
>>
>> have a new error of an older code, which used to work an which I
>> recompiled today:
>>
>>  The function BOOT::PAIR is undefined.
>>
>>
>> 346) -> )co dnf
>>    Compiling FriCAS source code from file
>> /Users/jgrabmeier/arbeiten/fricas/dnf/dnf.spad using
>>   old system compiler.
>>    TDNF abbreviates domain TermDisjunctiveNormalForm
>> 
>>    initializing NRLIB TDNF for TermDisjunctiveNormalForm
>>    compiling into NRLIB TDNF
>>
>>    >> System error:
>>    The function BOOT::PAIR is undefined.
>>
>> have stripped off the domain, the error occurs already with this skeleton:
>>
>> TermDisjunctiveNormalForm(n: NonNegativeInteger):
>>   public == private where
>>   public ==> PRestrictedDirectProductCategory(2, n, PRestrictedInteger(2))
>>   private ==> PRestrictedDirectProductInteger(2, n)
>>
>> The p restricted types compile without problems.
>>

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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/761befe8-1ebf-891c-8a44-03e5d4aa7cb4%40grabmeier.net.


[fricas-devel] The function BOOT::PAIR is undefined.

2020-10-16 Thread Prof. Dr. Johannes Grabmeier privat


Hi all,

have a new error of an older code, which used to work an which I
recompiled today:

 The function BOOT::PAIR is undefined.


346) -> )co dnf
   Compiling FriCAS source code from file
/Users/jgrabmeier/arbeiten/fricas/dnf/dnf.spad using
  old system compiler.
   TDNF abbreviates domain TermDisjunctiveNormalForm

   initializing NRLIB TDNF for TermDisjunctiveNormalForm
   compiling into NRLIB TDNF

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

have stripped off the domain, the error occurs already with this skeleton:

TermDisjunctiveNormalForm(n: NonNegativeInteger):
  public == private where
  public ==> PRestrictedDirectProductCategory(2, n, PRestrictedInteger(2))
  private ==> PRestrictedDirectProductInteger(2, n)

The p restricted types compile without problems.

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

-- 
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/9f047ab4-5c47-7a9d-1d8d-54af7e945f73%40grabmeier.net.


[fricas-devel] The function COMMON-LISP:PROG1 is undefined

2020-07-10 Thread Prof. Dr. Johannes Grabmeier privat
Hi all,
in my rework through the finite field stuff, I recently discover strange
errors message: "The function COMMON-LISP:PROG1 is undefined"
Any hint what  kind of problem is causing this?

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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/a9bc2b34-21a0-9d87-f8a0-fa73c6160dac%40grabmeier.net.


[fricas-devel] Print OutputFrom without end-of-line?

2020-04-10 Thread Prof. Dr. Johannes Grabmeier privat
would like to have a print functions with this feature, right now it
seems that print in OutputForm using print(x  == mathprint(x)$Lisp is
the only way. Would appreciate if the LISP experts indicate such a
function, the of course it should be possible to print an end-of-line, too.

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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/b8458a9f-bae5-1cd3-673f-9ae92fc6f7d4%40grabmeier.net.


[fricas-devel] Problem with Control stack

2020-03-25 Thread Prof. Dr. Johannes Grabmeier privat
Dear all,

in my revision work for finite fields from time to time I get Control
stack exhausted without finding the problem which causes it. (Same
computation in the unchanged current world computes correctly)

Two questions:

1. How can I modify in LISP the debugging to check whether one simply
has to change the behavoiur (debug level 2 ??)

2. How can I trace the in the debugging mode to find out the reason for
this error.

Thanks

Johannes


P.S: Have FriCAS 1.3.6 on SBCL 1.3.14 on a MacBook.



(6) -> G := FF(11,20)

   (6)  FiniteField(11,20)

 
Type: Type
(7) -> a : G := random()

   (7)
    19   18  17  16    15    14   13  12 
11  10   8  7  6
 2 α   + 10 α   + 7 α   + 3 α   + α   + α   + 10 α   + 9 α   + 4 α  
+ 7 α   + 10 α  + 4 α  + 5 α
   +
    5   4    3  2
 3 α  + 10 α  + α  + 5 α  + 9 α + 6
   
Type: FiniteField(11,20)
(8) -> discreteLog a
   Discrete logarithm tables initialized
INFO: Control stack guard page unprotected
Control stack guard page temporarily disabled: proceed with caution

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

PROCEED WITH CAUTION.

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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/c0955cb6-7e6b-f525-fd6f-ecffbbd9232c%40grabmeier.net.


[fricas-devel] Why do Finite Fields have DifferentialRing?

2020-01-05 Thread Prof. Dr. Johannes Grabmeier privat
Any reasons that FiniteFieldCategory requires all finite fields to be a
DifferentialRing with trivial implementation pf differentiate(x)  = 0? I
woud like to eliminate this.

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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/ca119fae-fd30-0305-b2cd-becbee699760%40grabmeier.net.


[fricas-devel] Finite and StepThrough

2020-01-05 Thread Prof. Dr. Johannes Grabmeier privat
Hi all,

Finite is Missing StepThrough! Any objection against adding a default
step through:

)abbrev category FINITE Finite
++ Author:
++ Basic Functions:
++ Related Constructors:
++ Also See:
++ AMS Classifications:
++ Keywords:
++ References:
++ Description:
++ The category of domains composed of a finite set of elements.
++ We include the functions \spadfun{lookup} and \spadfun{index} to give
a bijection
++ between the finite set and an initial segment of positive integers.
++
++ Axioms:
++   \spad{lookup(index(n)) = n}
++   \spad{index(lookup(s)) = s}
Finite() : Category == Join(SetCategory, ConvertibleTo InputForm,
    Comparable, StepThrough) with
    --operations
  size : () -> NonNegativeInteger
    ++ size() returns the number of elements in the set.
  index : PositiveInteger -> %
    ++ index(i) takes a positive integer i less than or equal
    ++ to \spad{size()} and
    ++ returns the \spad{i}-th element of the set. This
    ++ operation establishes a bijection
    ++ between the elements of the finite set and \spad{1..size()}.
  lookup : % -> PositiveInteger
    ++ lookup(x) returns a positive integer such that
    ++ \spad{x = index lookup x}.
  random : () -> %
    ++ random() returns a random element from the set.
  enumerate : () -> List %
    ++ enumerate() returns list of elements of the set.
  add
  random() == index((1+random(size()$%))::PositiveInteger)

  enumerate() == [index(i::PositiveInteger) for i in 1..size()]

  convert(x : %) : InputForm ==
  packageCall('index, [convert(lookup(x))@InputForm]
 )$InputFormFunctions1(%)

  if not(% has OrderedSet) then

  smaller?(x : %, y : %) : Boolean ==
  lookup(x) <$PositiveInteger lookup(y)
 
---
  -- exported functions from StepThrough:
 
---
  init() : % == index(1)
  nextItem(x: %): Union(%, "failed")  ==
    p : PositiveInteger := lookup(x)
    p = size() => "failed"
    index(p+1)

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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/e2c76220-5277-7612-b8f8-360083f56418%40grabmeier.net.


Re: [fricas-devel] revision of finite fields: WITHOUT

2019-11-26 Thread Prof. Dr. Johannes Grabmeier privat
I agree with your arguments. I would be content to have an
WITHOUT-statment, which "only" suppresses output of these functions in
)show and in )hd, perhaps with an additional )showall or so to see also
these still present, but for the user superfluous functions. And of
course the interpreter always should choose the functions of not WITHOUT
first (see my degree example)

Am 23.11.19 um 17:04 schrieb Waldek Hebisch:
> Johannes Grabmeier wrote:
>> I started a revision of the field stuff. E.g. Simple algebraic
>> extensions are MonogenicAlgebra 's, so I included this and learnt, that
>> in this case one inherits DifferentialExtension with more differential
>> operators.
>> I think noone needs them (please indicate, if there are other
>> opionons).  Actuallly, I also do not know, why we have a trivial
>> differential operator ( 0) in FiniteFieldCategory, because this category
>> claims to inherit vom DifferentialRing. Can anyone tell me, who needs
>> this, otherwise I would like to drop it.
> This is mainy issue of consistency: we build structures by recursion,
> so trivial cases are necessary as base case.  Also, we like to
> use generic algorithms and they may need such trivial operations.
> So definitely they should be present.
>
>> In any case, some domains have
>> functions inherited, which are no longer needed. E.g.
>> We have a degree function with values in OnePointCompletion
>> PositiveInteger to allow the degree of a transcendent element to be
>> infinite. However, in an algebraic extension of a finite field we never
>> have a transcendent element, hence degree should map to PositiveInteger.
>> So I want to drop the inherited degree function, because it is
>> superfluous. .
>>
>> A suggestion an question to the compiler specialists: Similar to "with"
>> can't we have a "without" to drop Categories or single functions.
> Again, such inherited functions must be present for consitency:
> they may be called by generic routines from categories.  It would
> be nice to be able to tell compiler and interpreter that they
> are "second class" and overload resolution should strongly
> prefer other version, but ATM even this is not possible.
>

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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/a77589ea-d2b6-4084-a3ea-c7dc31dc8d13%40grabmeier.net.


Re: [fricas-devel] revision of finite fields: WITHOUT

2019-11-26 Thread Prof. Dr. Johannes Grabmeier privat
18)  244860 %B + 157432
 Type:
FiniteFieldExtensionByPolynomial(FiniteField(103,2),?^2+(102*%B+101))


Time: 0 sec




Am 22.11.19 um 17:45 schrieb Ralf Hemmecke:
> Hello Johannes,
>
> That sounds like great news.
>
> For implementation of an ACF a la Steel, it would be good to also have
> the algebraic closure of GF(p) implemented. I think that should be
> doable by reducing by a triangular set of extension polynomials.
>
> Will you also look into this or should I implement it myself?
>
> Thank you
> Ralf
>
> PS: In Aldor instead of "without", I've seen "Meet" (the dual to Join),
> but I think that it is also not really implemented in Aldor.
>
> https://github.com/pippijn/aldor/blob/master/aldor/lib/aldor/src/lang/sal_lang.as#L93
>
>
> On 11/22/19 9:45 AM, Prof. Dr. Johannes Grabmeier privat wrote:
>> Hi all,
>>
>> I started a revision of the field stuff. E.g. Simple algebraic
>> extensions are MonogenicAlgebra 's, so I included this and learnt, that
>> in this case one inherits DifferentialExtension with more differential
>> operators.
>> I think noone needs them (please indicate, if there are other
>> opionons).  Actuallly, I also do not know, why we have a trivial
>> differential operator ( 0) in FiniteFieldCategory, because this category
>> claims to inherit vom DifferentialRing. Can anyone tell me, who needs
>> this, otherwise I would like to drop it. In any case, some domains have
>> functions inherited, which are no longer needed. E.g.
>> We have a degree function with values in OnePointCompletion
>> PositiveInteger to allow the degree of a transcendent element to be
>> infinite. However, in an algebraic extension of a finite field we never
>> have a transcendent element, hence degree should map to PositiveInteger.
>> So I want to drop the inherited degree function, because it is
>> superfluous. .
>>
>> A suggestion an question to the compiler specialists: Similar to "with"
>> can't we have a "without" to drop Categories or single functions.
>>

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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/d2672571-586d-7501-7c1f-6e1b01ec0d05%40grabmeier.net.
-- of Ralf Hemmecke of Nov. 2019
P ==> PositiveInteger
Z ==> Integer
SI ==> SingleInteger
maxi2 ==> shift(max()$SI, -1)::Z
p := qcoerce(prevPrime(maxi2)$IntegerPrimesPackage(Z))@P

p := nextPrime 100
F ==> PrimeField p
f := (x^4+x+1)::UP('x, F)
factor f
F2 ==> FiniteField(p, 2)
ff := factor(f::UP('x, F2))
fl := factorList ff
c2 := coefficient(fl.1.factor, 0)

w : F2 := primitiveElement()
order w
f2 : SUP F2 := monomial(1,2) - w

--F4 ==> FiniteFieldExtension(F2, 2)
F4 ==> FiniteFieldExtensionByPolynomial(F2, f2)
coerce(c2)$F4


[fricas-devel] revision of finite fields: WITHOUT

2019-11-22 Thread Prof. Dr. Johannes Grabmeier privat
Hi all,

I started a revision of the field stuff. E.g. Simple algebraic
extensions are MonogenicAlgebra 's, so I included this and learnt, that
in this case one inherits DifferentialExtension with more differential
operators.
I think noone needs them (please indicate, if there are other
opionons).  Actuallly, I also do not know, why we have a trivial
differential operator ( 0) in FiniteFieldCategory, because this category
claims to inherit vom DifferentialRing. Can anyone tell me, who needs
this, otherwise I would like to drop it. In any case, some domains have
functions inherited, which are no longer needed. E.g.
We have a degree function with values in OnePointCompletion
PositiveInteger to allow the degree of a transcendent element to be
infinite. However, in an algebraic extension of a finite field we never
have a transcendent element, hence degree should map to PositiveInteger.
So I want to drop the inherited degree function, because it is
superfluous. .

A suggestion an question to the compiler specialists: Similar to "with"
can't we have a "without" to drop Categories or single functions.

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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/343585a5-342a-536d-cac6-6c3f3de51acf%40grabmeier.net.


Re: [fricas-devel] FiniteField(Extension)-Problem

2019-11-14 Thread Prof. Dr. Johannes Grabmeier privat
I looked at it, but will have to go into more detail, perhaps a good
starting point to revise the whole field staff after 28 years, but would
take its time. Right now I had worked
on a such kind of domains anyway, as for a project I need

TranscendentalExtensionField

and

FiniteTranscendentalExtensionField

etc. to be able to construct towers of field extensions, either
algrebraic or transcendental.


Am 07.11.19 um 17:52 schrieb Ralf Hemmecke:
> Hello Johannes,
>
> as one of the authors of the finite field implementation you might
> probably be able to tell me what is happening here, see attachment.
>
> The last
>
>   coerce(c2)$F4
>
> takes nearly 18 seconds on my laptop (first time only, of course).
> That's probably due to the computation of the discrete logarithm table.
>
> Unfortunately, for p>10^6 that makes the finite field implementation
> impractical (at least for my purpose).
>
> Actually, I wonder why it takes so long. Is there really need to trigger
> the computation of the table. Doesn't this "coerce" (inclusion of F2
> into F4) just mean consider c2 as a constant polynomial in the
> representation (SAE) of F4?
>
> Maybe some background for my problem.
> In fact, I want to implement algebraic numbers via the following paper.
>
> @article{Steel:AlgebraicallyClosedFields:2010,
>   author =   {Allan K. Steel},
>   title ={Computing with algebraically closed fields},
>   journal =  {Journal of Symbolic Compuation},
>   volume =   45,
>   number =   3,
>   pages ={342--372},
>   year = 2010,
>   issn = {0747-7171},
>   doi =  {10.1016/j.jsc.2009.09.005},
>   url =
> {http://www.sciencedirect.com/science/article/pii/S0747717109001497},
>   keywords = {Algebraic closure, Algebraic number field, Algebraic
>   function field, Field extension, Inseparability,
>   Non-perfect field, Polynomial factorization, Root
>   finding},
> }
>
> As far as I understand, this needs an "evaluation (finite) field" in
> which there are enough roots. So potentially, I'd need the algebraic
> closure of a prime field of a prime characteristic close to machine
> integer size.
>
> Any idea how such a field could be implemented in FriCAS?
>
> I thought, I could somehow use FiniteFieldExtension to dynamically grow
> this "evaluation field", but the above problem hinders me in thinking
> further in this direction.
>
> Ralf
>

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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/b10e3674-a652-57cf-c3df-bd812471cfae%40grabmeier.net.


[fricas-devel] ARRAY2 enhanced

2019-11-04 Thread Prof. Dr. Johannes Grabmeier privat
Hi all,
I have enhanved TwoDimensionalArray to include arithmetic for block
matrices and have an operation array2 (similar to matrix for Matrix) for
easy creation of
two-dimensional array and would suggest to include this into the next
version:

(1) -> )r array2-jg-test
A11 := matrix [[2]]


   (1)  [2]
  
Type: Matrix(Integer)
A12 := matrix [[1,2,3]]


   (2)  [1  2  3]
  
Type: Matrix(Integer)
A21 := matrix [[1],[7]]


    +1+
   (3)  | |
    +7+
  
Type: Matrix(Integer)
A22 := matrix [[-3,1,0],[5,5,3]]


    +- 3  1  0+
   (4)  | |
    + 5   5  3+
  
Type: Matrix(Integer)
A := array2([[A11, A12],[A21, A22]])$ARRAY2(Matrix Integer)


    +[2]   [1  2  3] +
    |    |
   (5)  |+1+  +- 3  1  0+|
    || |  | ||
    ++7+  + 5   5  3++
  Type:
TwoDimensionalArray(Matrix(Integer))
B11 := matrix [[2]]


   (6)  [2]
  
Type: Matrix(Integer)
B21:= matrix [[2],[3], [1]]


    +2+
    | |
   (7)  |3|
    | |
    +1+
  
Type: Matrix(Integer)
B := array2 [[B11],[B21]]$ARRAY2(Matrix Integer)


    +[2]+
    |   |
    |+2+|
   (8)  || ||
    ||3||
    || ||
    ++1++
  Type:
TwoDimensionalArray(Matrix(Integer))
A


    +[2]   [1  2  3] +
    |    |
   (9)  |+1+  +- 3  1  0+|
    || |  | ||
    ++7+  + 5   5  3++
  Type:
TwoDimensionalArray(Matrix(Integer))
B


 +[2]+
 |   |
 |+2+|
   (10)  || ||
 ||3||
 || ||
 ++1++
  Type:
TwoDimensionalArray(Matrix(Integer))
A*B


 +[15] +
 | |
   (11)  |+- 1+|
 ||   ||
 ++42 ++
  Type:
TwoDimensionalArray(Matrix(Integer))

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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/2fa80ab2-6eb3-2a41-bb78-c397fdb08063%40grabmeier.net.
)abbrev category ARR2CAT TwoDimensionalArrayCategory
++ Two dimensional array categories and domains
++ Author:
++ Date Created: 27 October 1989
++   updated J. Grabmeier November 2019: columnSums, rowSums
++   updated J. Grabmeier August 2019: array2, *, arrayMultiply
++ Keywords: array, data structure
++ Examples:
++ References:
TwoDimensionalArrayCategory(R, Row, Col) : Category == Definition where
  ++ TwoDimensionalArrayCategory is a general array category which
  ++ allows different representations and indexing schemes.
  ++ Rows and columns may be extracted with rows returned as objects
  ++ of type Row and columns returned as objects of type Col.
  ++ The index of the 'first' row may be obtained by calling the
  ++ function 'minRowIndex'.  The index of the 'first' column may
  ++ be obtained by calling the function 'minColIndex'.  The index of
  ++ the first element of a 'Row' is the same as the index of the
  ++ first column in an array and vice versa.
  R   : Type
  Row : IndexedAggregate(Integer, R)
  Col : IndexedAggregate(Integer, R)

  PI ==> PositiveInteger
  NNI ==> NonNegativeInteger
  LNNI ==> List(NNI)
  LI ==> List(Integer)
  SI ==> Segment(Integer)
  LSI ==> List(SI)

  Definition == Join(HomogeneousAggregate(R), _
  shallowlyMutable, finiteAggregate) with

if R has Comparable then Comparable

--% Array creation

new : (NonNegativeInteger, NonNegativeInteger, R) -> %
  ++ new(m, n, r) is an m-by-n array all of whose entries are r
qnew : (NonNegativeInteger, NonNegativeInteger) -> %
  ++ qnew(m, n) is is an m-by-n uninitilized array
fill! : (%, R) -> %
  ++ fill!(m, r) fills m with r's
array2: List List R -> %
  ++ array2(lili) constructs a 2-dimensional array, the inner list being 
the rows.

--% Size inquiries

minRowIndex : % -> Integer
  ++ minRowIndex(m) returns the index of the 'first' row of the array m
maxRowIndex : % -> Integer
  ++ 

[fricas-devel] Error not of type SIMPLE-VECTOR

2019-10-29 Thread Prof. Dr. Johannes Grabmeier privat
   >> System error:
   The value
  ((("wa" . #1=(0 . 1)) ("ka" . #1#) ("tr" . #1#) ("ws" . #1#)))
is not of type
  SIMPLE-VECTOR

Any idea what is going on. It seems that after compilation, a certain
program runs, then I start another to get this bug, then the first
program all of a sudden has this problem, recompilation, and it runs again.

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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/ea745eb1-884c-81a3-1443-dc7b167f8a42%40grabmeier.net.


[fricas-devel] Hot to implement a binary operation "->"?

2019-08-21 Thread Prof. Dr. Johannes Grabmeier privat
would like to have a binary operation -> (or something similar, e.g. =>,
==>, -->". How to handle this properly with all these special meanings?

The code


LatticeAlgebra: Category == Join(HeytingAlgebra, Monoid,
CommutativeStar) with
  --operations

    "->":   (%, %) -> %

  add

    ((x: %) *  (y: %)): % == ...
    ((x: %) -> (y: %)): % ==. ..

compiles properly, it is shown with )show:

 ?*? : (%, %) -> % ?->? : (%, %) -> %
 ?/\ : List(%) -> %    ?/\? : (%, %) -> %
 ? Boolean   ?<=? : (%, %) -> Boolean
 ?=? : (%, %) -> Boolean   ?>? : (%, %) -> Boolean
 ?>=? : (%, %) -> Boolean  1 : () -> %
 0 : () -> %   ?\/ : List(%) -> %




But the interpreter seems not be able to call this function:

(15) -> a

   (15)  0

Type: BooleanLatticeAlgebra
(16) -> b

   (16)  1

Type: BooleanLatticeAlgebra
(17) -> a -> b
   There are 29 exposed and 5 unexposed library operations named elt
having 2 argument(s) but
  none was determined to be applicable. Use HyperDoc Browse, or issue
  )display op elt
  to learn more about the available operations. Perhaps
package-calling the operation or
  using coercions on the arguments will allow you to apply the
operation.

   Cannot find a definition or applicable library operation named
Mapping with argument
  type(s)
   BooleanLatticeAlgebra
   BooleanLatticeAlgebra

  Perhaps you should use "@" to indicate the required return type,
or "$" to specify which
  version of the function you need.

(17) -> a "->" b
   There are no library operations named "->"
  Use HyperDoc Browse or issue
   )what op "->"
  to learn if there is any operation containing " "->" " in its name.

   Cannot find a definition or applicable library operation named "->"
with argument type(s)
   BooleanLatticeAlgebra

  Perhaps you should use "@" to indicate the required return type,
or "$" to specify which
  version of the function you need.

(17) -> a _-> b
   There are no library operations named a
  Use HyperDoc Browse or issue
 )what op a
  to learn if there is any operation containing " a " in its name.

   Cannot find a definition or applicable library operation named a with
argument type(s)
    Variable(-)

  Perhaps you should use "@" to indicate the required return type,
or "$" to specify which
  version of the function you need.

(17) -> a _-_> b

   >> System error:
   The value
  |b|
is not of type
  LIST


Any ideas / workarounds?

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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/bb6d6071-5750-3ba8-31ee-008bde1fefd8%40grabmeier.net.


Re: [fricas-devel] Localizations

2019-05-14 Thread Prof. Dr. Johannes Grabmeier privat
yes, my code is not yet in a showable shape, I will finalize it asap.

Am 11.05.19 um 17:08 schrieb Ralf Hemmecke:
> On 5/11/19 12:23 PM, Prof. Dr. Johannes Grabmeier privat wrote:
>> I have various implementations and improbement of localizations done, if
>> interested I can go through it again and we can think how we improve the
>> current code.
> Do you mean improvement of
> https://github.com/hemmecke/fricas/blob/master-hemmecke/src/algebra/fraction.spad#L1
> ?
>
> Do you have some repository I can look at?
>
> Ralf
>

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/babe9162-9987-9537-30a4-61b1ca9e6ed5%40grabmeier.net.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] Localizations

2019-05-11 Thread Prof. Dr. Johannes Grabmeier privat
I have various implementations and improbement of localizations done, if
interested I can go through it again and we can think how we improve the
current code.

Am 10.05.18 um 16:30 schrieb Waldek Hebisch:
> Various localizations seem to play important role in algebra
> so we would like to support them.  ATM I am not sure how
> to implement more general localizations.  However, as
> a small step I looked at IntegerLocalizedAtPrime.  It compiles
> when I replaced Z by a GcdDomain R and Q by Fraction(R).
> And AFACS it should work correctly with such assumptions.
> The only exception is call to 'prime?' which checks is
> argument is indeed a prime.
>
> Ralf, is there some strong reason to keep this domain
> limited to integers?  General version probably will
> be slower because calls to integer operations can be
> inlined and general R would use normal calls -- if
> integer case is critical we can have conditional
> implementation so that speed in special case is
> better than in general case.
>

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/bc3d0ae1-fa79-725d-0c9b-02dea4ed45d6%40grabmeier.net.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] StepThrough for NNI and PI

2019-05-06 Thread Prof. Dr. Johannes Grabmeier privat
While Integer inherits from IntegerNumberSystem the category
StepThrough, the domains NNI and PI do not share this natural property.
I have added this, however, while init() overwrites the inherited
functiom init() (as a subdomain of Integer), this is not the case for
the correct nextItem, i.e. the interpreter chooses the function from
Integer and not from the domain PI itsself:

(1) -> init()$Integer

   (1)  0

  
Type: Integer
(2) -> nextItem %

   (2)  1
   
Type: Union(Integer,...)
(3) -> nextItem %

   (3)  - 1
   
Type: Union(Integer,...)
(4) -> nextItem %

   (4)  2
   
Type: Union(Integer,...)


after compilation of integer-jg.spad, which I include:


(6) -> init()$NNI

   (6)  0
   
Type: NonNegativeInteger
(7) -> nextItem %

   (7)  1
   
Type: Union(Integer,...)
(8) -> nextItem %

   (8)  - 1
   
Type: Union(Integer,...)
(9) -> init()$PI

   (9)  1
  
Type: PositiveInteger
(10) -> nextItem %

   (10)  - 1
   
Type: Union(Integer,...

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/7ba1d628-1857-6239-b18f-f757b0ff8df6%40grabmeier.net.
For more options, visit https://groups.google.com/d/optout.
)abbrev package INTSLPE IntegerSolveLinearPolynomialEquation
++ Author: Davenport
++ Date Created: 1991
++ Basic Functions:
++ Related Constructors:
++ Also See:
++ AMS Classifications:
++ Keywords:
++ References:
++ Description:
++ This package provides the implementation for the
++ \spadfun{solveLinearPolynomialEquation}
++ operation over the integers. It uses a lifting technique
++ from the package GenExEuclid
IntegerSolveLinearPolynomialEquation() : C ==T
 where
  ZP ==> SparseUnivariatePolynomial Integer
  C == with
  solveLinearPolynomialEquation : (List ZP,ZP) -> Union(List ZP,"failed")
   ++ solveLinearPolynomialEquation([f1, ..., fn], g)
   ++ (where the fi are relatively prime to each other)
   ++ returns a list of ai such that
   ++ \spad{g/prod fi = sum ai/fi}
   ++ or returns "failed" if no such list of ai's exists.
  T == add
  oldlp : List ZP := []
  slpePrime : Integer := (2::Integer)
  oldtable : Vector List ZP := empty()
  solveLinearPolynomialEquation(lp, p) ==
 if (oldlp ~= lp) then
-- we have to generate a new table
deg := _+/[degree u for u in lp]
ans : Union(Vector List ZP, "failed") := "failed"
slpePrime := 2147483647::Integer   -- 2^31 -1 : a prime
 -- a good test case for this package is
 --  ([x^31-1, x-2], 2)
while (ans case "failed") repeat
  ans := tablePow(deg, slpePrime, lp)$GenExEuclid(Integer, ZP)
  if (ans case "failed") then
 slpePrime := prevPrime(slpePrime)$IntegerPrimesPackage(Integer)
oldtable := (ans:: Vector List ZP)
 answer := solveid(p, slpePrime, oldtable)
 answer

)abbrev domain INT Integer
++ Author:
++ Basic Operations:
++ Related Constructors:
++ Keywords: integer
++ Description: \spadtype{Integer} provides the domain of arbitrary precision
++ integers.

Integer : Join(IntegerNumberSystem, LinearlyExplicitOver Integer,
   PolynomialFactorizationExplicit, ConvertibleTo String,
   OpenMath, Canonical, canonicalsClosed) with
random   : % -> %
  ++ random(n) returns a random integer from 0 to \spad{n-1}.
 == add
  ZP ==> SparseUnivariatePolynomial %
  ZZP ==> SparseUnivariatePolynomial Integer
  x, y : %

  writeOMInt(dev : OpenMathDevice, x : %) : Void ==
if x < 0 then
  OMputApp(dev)
  OMputSymbol(dev, "arith1", "unary_minus")
  OMputInteger(dev, (-x) pretend Integer)
  OMputEndApp(dev)
else
  OMputInteger(dev, x 

[fricas-devel] Fwd: New Category OutputType

2019-03-27 Thread Prof. Dr. Johannes Grabmeier privat
sorry, the new category is named OutputType


 Weitergeleitete Nachricht 
Betreff:New Category OutputForm
Datum:  Wed, 27 Mar 2019 17:05:33 +0100
Von:Prof. Dr. Johannes Grabmeier privat 
An: fricas-devel@googlegroups.com



Dear all,

I am just adding and correcting feature to basic algebraic domains, e.g.
SAE, LocalAlgebra and Fraction, as for example simplification
is not implemented yet for certain non standard situations, (already
fixed):


(1) -> x : UTS(FRAC INT, 'x, 0)

 
Type: Void
(2) -> u := 1+x

   (2)  1 + x
 Type:
UnivariateTaylorSeries(Fraction(Integer),x,0)
(3) -> v := x+x^2

 2
   (3)  x + x
 Type:
UnivariateTaylorSeries(Fraction(Integer),x,0)
(4) -> u/v

 1 + x
   (4)  --
 2
    x + x
   Type:
Fraction(UnivariateTaylorSeries(Fraction(Integer),x,0))
(5) -> uInv := recip u

 2    3    4    5    6    7    8    9    10  11
   (5)  1 - x + x  - x  + x  - x  + x  - x  + x  - x  + x   + O(x  )
  Type:
Union(UnivariateTaylorSeries(Fraction(Integer),x,0),...)

To this end I came to change the output of SAE - and for that I invented
a Category, which easily
allows the user to change the coercion to OutputForm. I suggest to
include that into the system
to be able to use that on several places, e.g. different form of
permutation representations as
Lehmer code (e.g.).

Here is an example:

(101) -> x

   +-+
   (101)  \|2
    Type:
SimpleAlgebraicExtension(Integer,UnivariatePolynomial(x,Integer),x^2+(-2))
(102) -> x+3

   +-+
   (102)  \|2  + 3
    Type:
SimpleAlgebraicExtension(Integer,UnivariatePolynomial(x,Integer),x^2+(-2))
(103) -> (x+3)^2

 +-+
   (103)  6 \|2  + 11
    Type:
SimpleAlgebraicExtension(Integer,UnivariatePolynomial(x,Integer),x^2+(-2))
(104) -> setOutputType("rel")$S

   (104)  "rel"

   
Type: String
(105) -> (x+3)^2

    2
   (105)  6 ζ + 11  |  ζ  - 2  = 0
    Type:
SimpleAlgebraicExtension(Integer,UnivariatePolynomial(x,Integer),x^2+(-2))
(106) -> setOutputType("poly")$S

   (106)  "poly"

   
Type: String
(107) -> (x+3)^2

   (107)  6 x + 11
    Type:
SimpleAlgebraicExtension(Integer,UnivariatePolynomial(x,Integer),x^2+(-2))


Actually, I even suggest to use the nice "rel" variant as the standard.
Can we in general rely on
UTF greek symbols?

Here is the code of the Category.

-- Copyright (c) 2019 J. Grabmeier
-- All rights reserved.
-- version 1 25.03.2019

)abbrev category OUTTYPE OutputType

++ Author: J. Grabmeier
++ Date Created:
++ Date Last Updated:
++ Basic Functions:
++ Related Constructors:
++ Also See:
++ AMS Classifications:
++ Keywords:
++ References:
++ Description:
++   provides environment for user choosable output types of the objects.
OutputType(opT: List String): Category == with
  --operations
    outputType: () -> String
  ++ setOutputType changes the output type.
    setOutputType: String -> String
  ++ setOutputType changes the output type.
  add
    --if empty? opT then error "OutputType: Argument must be a non empty
list of strings."
    msg: OutputForm := commaSeparate [message(op) for op in opT]
    msg := blankSeparate [message "OutputType: Improper value, correct
values are", msg]
    referenceOutputType: Reference String := ref first opT
    outputType(): String == deref referenceOutputType
    setOutputType(st: String): String ==
  correctType? : Boolean := false
  lb : List Boolean := [st = tp for tp in opT]
  correctType? := correctType? or reduce(_or, lb)
  if correctType?
    then referenceOutputType := ref st
    else print msg
  st

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688


-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

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

[fricas-devel] New Category OutputForm

2019-03-27 Thread Prof. Dr. Johannes Grabmeier privat
Dear all,

I am just adding and correcting feature to basic algebraic domains, e.g.
SAE, LocalAlgebra and Fraction, as for example simplification
is not implemented yet for certain non standard situations, (already
fixed):


(1) -> x : UTS(FRAC INT, 'x, 0)

 
Type: Void
(2) -> u := 1+x

   (2)  1 + x
 Type:
UnivariateTaylorSeries(Fraction(Integer),x,0)
(3) -> v := x+x^2

 2
   (3)  x + x
 Type:
UnivariateTaylorSeries(Fraction(Integer),x,0)
(4) -> u/v

 1 + x
   (4)  --
 2
    x + x
   Type:
Fraction(UnivariateTaylorSeries(Fraction(Integer),x,0))
(5) -> uInv := recip u

 2    3    4    5    6    7    8    9    10  11
   (5)  1 - x + x  - x  + x  - x  + x  - x  + x  - x  + x   + O(x  )
  Type:
Union(UnivariateTaylorSeries(Fraction(Integer),x,0),...)

To this end I came to change the output of SAE - and for that I invented
a Category, which easily
allows the user to change the coercion to OutputForm. I suggest to
include that into the system
to be able to use that on several places, e.g. different form of
permutation representations as
Lehmer code (e.g.).

Here is an example:

(101) -> x

   +-+
   (101)  \|2
    Type:
SimpleAlgebraicExtension(Integer,UnivariatePolynomial(x,Integer),x^2+(-2))
(102) -> x+3

   +-+
   (102)  \|2  + 3
    Type:
SimpleAlgebraicExtension(Integer,UnivariatePolynomial(x,Integer),x^2+(-2))
(103) -> (x+3)^2

 +-+
   (103)  6 \|2  + 11
    Type:
SimpleAlgebraicExtension(Integer,UnivariatePolynomial(x,Integer),x^2+(-2))
(104) -> setOutputType("rel")$S

   (104)  "rel"

   
Type: String
(105) -> (x+3)^2

    2
   (105)  6 ζ + 11  |  ζ  - 2  = 0
    Type:
SimpleAlgebraicExtension(Integer,UnivariatePolynomial(x,Integer),x^2+(-2))
(106) -> setOutputType("poly")$S

   (106)  "poly"

   
Type: String
(107) -> (x+3)^2

   (107)  6 x + 11
    Type:
SimpleAlgebraicExtension(Integer,UnivariatePolynomial(x,Integer),x^2+(-2))


Actually, I even suggest to use the nice "rel" variant as the standard.
Can we in general rely on
UTF greek symbols?

Here is the code of the Category.

-- Copyright (c) 2019 J. Grabmeier
-- All rights reserved.
-- version 1 25.03.2019

)abbrev category OUTTYPE OutputType

++ Author: J. Grabmeier
++ Date Created:
++ Date Last Updated:
++ Basic Functions:
++ Related Constructors:
++ Also See:
++ AMS Classifications:
++ Keywords:
++ References:
++ Description:
++   provides environment for user choosable output types of the objects.
OutputType(opT: List String): Category == with
  --operations
    outputType: () -> String
  ++ setOutputType changes the output type.
    setOutputType: String -> String
  ++ setOutputType changes the output type.
  add
    --if empty? opT then error "OutputType: Argument must be a non empty
list of strings."
    msg: OutputForm := commaSeparate [message(op) for op in opT]
    msg := blankSeparate [message "OutputType: Improper value, correct
values are", msg]
    referenceOutputType: Reference String := ref first opT
    outputType(): String == deref referenceOutputType
    setOutputType(st: String): String ==
  correctType? : Boolean := false
  lb : List Boolean := [st = tp for tp in opT]
  correctType? := correctType? or reduce(_or, lb)
  if correctType?
    then referenceOutputType := ref st
    else print msg
  st

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/23bd0789-4cac-c86d-e1bf-1d55f37f3ffb%40grabmeier.net.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] Build Report for Fricas 1.3.5

2019-02-14 Thread Prof. Dr. Johannes Grabmeier privat
worked also without any problem for me:


MacBook Pro 2015
2,5 GHz Intel Core i7
Number of Processors:    1
Total Number of Cores:    4
Memory 16 GB
macOS High Sierra Vs. 10.13.6
SBCL 1.3.14


fricas-1.3.5-full.tar.bz2
/configure
make
make check
and
make install

  
=
   Testsuite: vsbasis
 failed (total): 0 (3)

  
=
   testsuite | testcases: failed (total) | tests: failed (total)
   vsbasis 0 (3)   0    (22)
  
=
   File summary.
   unexpected failures: 0
   expected failures: 0
   unexpected passes: 0
   total tests: 22


Am 12.02.19 um 05:36 schrieb Jalaluddin Abdullah:
> Greetings,
>
> MacPro4,1
> Quad-Core Intel Xeon 2.66 GHz
> Number of Processors:    1
> Total Number of Cores:    4
> Memory:    10 GB
>
> OS 10.11.6
>
> SBCL 1.2.7
>
> GMP 6.1.2_1
>
> fricas-1.3.5-full.tar.bz2
>
> ./configure --enable-gmp
>
> make
>
> make check
>
> =
>
>    Testsuite: vsbasis
>  failed (total): 0 (3)
>
> =
>
>    testsuite | testcases: failed (total) | tests: failed (total)
>    vsbasis 0 (3)   0    (22)
> =
>
>    File summary.
>    unexpected failures: 0
>    expected failures: 0
>    unexpected passes: 0
>    total tests: 22
>
> su
>
> make install
>
>
> I checked a 3D graphics example and it worked.
>
>
> A restful build as usual
>
>
> Best Regards
>
>
> Jalaluddin
>
>

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/2c7e8d20-cde2-2686-ce20-5a1680292a76%40grabmeier.net.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] Greek letters in Symbol

2018-09-17 Thread Prof. Dr. Johannes Grabmeier privat
I have extended Symbol to easily create Greek letters and think about
suggesting a change of the default (algebra) genererators
in finite fields from %A, %B to α, β. Any counter arguments?



(64) -> newGreek()$Symbol

   (64)  α

   
Type: Symbol
(65) -> newGreek()$Symbol

   (65)  β

   
Type: Symbol
(66) -> newGreek()$Symbol

   (66)  γ

   
Type: Symbol
(67) -> new()$Symbol

   (67)  %A

   
Type: Symbol
(68) -> new()$Symbol

   (68)  %B

   
Type: Symbol
(69) -> new()$Symbol

   (69)  %C

   
Type: Symbol
(70) -> newGreek()$Symbol

   (70)  δ

   
Type: Symbol
(71) -> resetNew()$Symbol

 
Type: Void
(72) -> new()$Symbol

   (72)  %A

   
Type: Symbol
(73) -> newGreek()$Symbol

   (73)  ε

   
Type: Symbol
(74) -> resetNewGreek()$Symbol

 
Type: Void
(75) -> newGreek()$Symbol

   (75)  α

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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.
)abbrev domain SYMBOL Symbol
++ Author: Stephen Watt
++ Date Created: 1986
++ Date Last Updated: 17.09.2018 J. Grabmeier
++ Description:
++   Basic and scripted symbols. Extended to easily created Greek letters as 
symbols.
++ Keywords: symbol.
Symbol() : Exports == Implementation where
  L ==> List OutputForm
  Scripts ==> Record(sub : L, sup : L, presup : L, presub : L, args : L)

  Exports ==> Join(OrderedSet, ConvertibleTo InputForm, OpenMath,
ConvertibleTo Symbol,
 ConvertibleTo Pattern Integer, ConvertibleTo Pattern Float,
  PatternMatchable Integer, PatternMatchable Float) with
 new : () -> %
   ++ new() returns a new symbol whose name starts with %.
 newGreek : () -> %
   ++ newGreek() returns the next greek character.
 new : % -> %
   ++ new(s) returns a new symbol whose name starts with %s.
 resetNew : () -> Void
   ++ resetNew() resets the internals counters that new() and
   ++ new(s) use to return distinct symbols every time.
 resetNewGreek : () -> Void
   ++ resetNewGreek() resets the internals counters that newGreek() 
   ++ use to return distinct symbols every time.
 coerce : String -> %
   ++ coerce(s) converts the string s to a symbol.
 name : % -> %
   ++ name(s) returns s without its scripts.
 scripted? : % -> Boolean
   ++ scripted?(s) is true if s has been given any scripts.
 scripts : % -> Scripts
   ++ scripts(s) returns all the scripts of s.
 script : (%, List L) -> %
   ++ script(s, [a, b, c, d, e]) returns s with subscripts a,
   ++ superscripts b, pre-superscripts c, pre-subscripts d,
   ++ and argument-scripts e.  Omitted components are taken to be empty.
   ++ For example, \spad{script(s, [a, b, c])} is equivalent to
   ++ \spad{script(s, [a, b, c, [], []])}.
 script : (%, Scripts) -> %
   ++ script(s, [a, b, c, d, e]) returns s with subscripts a,
   ++ superscripts b, pre-superscripts c, pre-subscripts d,
   ++ and argument-scripts e.
 subscript : (%, L) -> %
   ++ subscript(s, [a1, ..., an]) returns s
   ++ subscripted by \spad{[a1, ..., an]}.
 superscript : (%, L) -> %
   ++ superscript(s, [a1, ..., an]) returns s
   ++ superscripted by \spad{[a1, ..., an]}.
 argscript : (%, L) -> %
   ++ argscript(s, [a1, ..., an]) returns s
   ++ arg-scripted by \spad{[a1, ..., an]}.
 elt : (%, L) -> %
   ++ elt(s, [a1, ..., an]) or s([a1, ..., an]) returns s subscripted by 
\spad{[a1, ..., an]}.
 string : % -> String
   ++ string(s) 

[fricas-devel] Difference between Compiler and Interpreter w.r.to infix functions

2018-09-06 Thread Prof. Dr. Johannes Grabmeier privat
Hi all,

I implemented signatures e.g. normalKernel  depending in a package
depending on Field K with the additional
condition:

if K has "^": (K, Fraction Integer) -> K

The function works without package calling for K = Float

(125) -> normalKernel(x, lvf_cb, Hinv)

   (125)  0.8359433134_9085011644 E -2172


Type: Float
Strange enough, it is not shown via )show

(130) -> )sh KernelDensityEstimation(Float)
 KernelDensityEstimation(Float) is a domain constructor.
 Abbreviation for KernelDensityEstimation is KDENSEST
 This constructor is exposed in this frame.
 13 Names for 14 Operations in this Domain.
--- Operations
---

 dashLine : () -> OutputForm   dottedLine : () ->
OutputForm
 equalLine : () -> OutputForm  line : String ->
OutputForm
 meanValue : List(Float) -> Float  messageLevel? : () ->
NonNegativeInteger
 messageLevelPointers : () -> List(Boolean)    varianceEstimation :
List(Float) -> Float
 densityEstimation : (Float, List(Float), (Float -> Float), Float) -> Float
 densityEstimation : (Vector(Float), List(Vector(Float)), (Vector(Float)
-> Float), Float) -> Vector(Float)
 meanValues : List(Vector(Float)) -> Vector(Float)
 messageLevelPointer : NonNegativeInteger -> Boolean
 setMessageLevel : NonNegativeInteger -> NonNegativeInteger
 varianceEstimations : List(Vector(Float)) -> Vector(Float)

The reason seems to have to do with the following strange behaviour:

(130) -> Float has "^": (Float, Fraction Integer) -> Float

   (130)  false

  
Type: Boolean
(131) -> Float has ^: (Float, Fraction Integer) -> Float

   (131)  true

I think one should have consistant use of "^"!


--
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

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


[fricas-devel] UTF-Characters in FriCAS

2018-08-28 Thread Prof. Dr. Johannes Grabmeier privat
I would like to use e.g. Greek letters instead of the awful %A, %B in
finite fields:


(68) -> greekLetters := [index(i)$Character :: String :: Symbol for i in
946 .. 970]

   (68)  [α, β, γ, δ, ε, ζ, η, θ, ι, κ, λ, μ, ν, ξ, ο, π, ρ, ς, σ, τ, υ,
φ, χ, ψ, ω]

 
Type: List(Symbol)

However, this character obey not to the same fixed width rules as normal
ASCII characters:

(69) -> sCA_rb

  + 2   2   2    +  +   2  2
2    +
  |α + 1   α  + α + 1  α   α  + 1|  |  α  + 1    α + 1    α
α  + α + 1|
   (69)  [|  |,
| |]
  | 2    |  | 2 
2 2  |
  +α  + α  α   α   α + 1 +  +α  + α + 1    1    α  +
1    α  + α  +
    Type:
List(Matrix(FiniteFieldSymbol(2,3,α)))


This is how the normal output in FriCAS session occurs.

In the E-Mail I can switch to fixed width as follows and then it is o.k.
So is it only a question which fonts one has in the terminal in which
FriCAS runs? But all the ASCII character
work well without having set this:



(69) -> sCA_rb

  + 2   2   2    +  +   2  2
2    +
  |α + 1   α  + α + 1  α   α  + 1|  |  α  + 1    α + 1    α
α  + α + 1|
   (69)  [|  |,
| |]
  | 2    |  | 2 
2 2  |
  +α  + α  α   α   α + 1 +  +α  + α + 1    1    α  +
1    α  + α  +
    Type:
List(Matrix(FiniteFieldSymbol(2,3,α)))



Any idea how to fix this little problem?

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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] Bug in finite field generator() function?

2018-08-23 Thread Prof. Dr. Johannes Grabmeier privat
no bug!

generator() does not necessarily return a primitive element, which
generates the cyclic group (F-{0},*)! It returns an element which generates
the algebra, so the result is correct.

See comment:

generator : () -> %
++ generator() returns a root of the defining polynomial.
++ This element generates the field as an algebra over the ground field.

Perhaps you want to use

primitiveElement()$F16

(84) -> w := primitiveElement()$FFP(PF 2, p)

   (84)  %E + 1
   Type:
FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?^3+?^2+?+1)
(85) -> order w

   (85)  15
  
Type: PositiveInteger




Am 23.08.18 um 23:22 schrieb Paul Onions:
> Hi All,
>
> It seems that calling generator() on a field created with
> FiniteFieldExtensionByPolynomial may not return a primitive element of
> the field.  Specifically, when the field is created using an
> irreducible (but not primitive) polynomial.
>
> Example:-
>
> (1) -> p : UP(x,PrimeField(2)) := x^4 + x^3 + x^2 + x + 1
>
>  432
>(1)  x  + x  + x  + x + 1
>   Type: UnivariatePolynomial(x,PrimeField(2))
> (2) -> F16 := FiniteFieldExtensionByPolynomial(PrimeField(2), p)
>
>(2)  FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?^3+?^2+?+1)
>Type: Type
> (3) -> g := generator()$F16
>
>(3)  %A
> Type: FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?^3+?^2+?+1)
> (4) -> g^5
>
>(4)  1
> Type: FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?^3+?^2+?+1)
>
> Looking at the source (ffp.spad) it looks like the implementation of
> generator() assumes that the defining polynomial is primitive, but the
> comments at the head of the file clearly state that the only
> requirement on the defining polynomial is that it be irreducible.
>
> Am I misunderstanding something here?
> Paul
>

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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] eigenvalues

2018-07-27 Thread Prof. Dr. Johannes Grabmeier privat
I think you have to do "by hand":  I assume the first %p ist meant to be
%pi as well:



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

    +  %pi    %i %e+
   (5)  |  |
    |    2 |
    +- %i %e  %pi  +
  Type:
Matrix(Expression(Complex(Integer)))


(6) -> cP := characteristicPolynomial(m,x)

    2    2 2  3
   (6)  - %e  + x  + (- %pi  - %pi)x + %pi
  Type:
Expression(Complex(Integer))

(7) -> solve(cP, x)

   (7)
 ++
 |    2  4    3  2   2
    \|4 %e  + %pi  - 2 %pi  + %pi   + %pi  + %pi
   [x = ,
  2
   ++
   |    2  4    3  2   2
    - \|4 %e  + %pi  - 2 %pi  + %pi   + %pi  + %pi
    x = --]
   2
  Type:
List(Equation(Expression(Complex(Integer





Am 27.07.18 um 16:21 schrieb Riccardo GUIDA:
> Hi
>
> does anybody know how to compute the eigenvalues of
>
> (1) -> m:= matrix [[%p, %i *%e],[-%i*%e,%pi^2]]
>
>     ┌  %p %i %e┐
>    (1)  │  │
>     │    2 │
>     └- %i %e  %pi  ┘
>
> with one of friCAS eigenvalues function?
>
> Thanks in advance, Riccardo
>

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

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


[fricas-devel] E has (1:( ) -> E) does not work

2018-07-05 Thread Prof. Dr. Johannes Grabmeier privat
What is the proper way to qualify a type E to have a constant or a
function with no variables?
Other functions work well, here are examples from the algebra code.


if R has imaginary : () -> R then

if SMPF has _*: (NonNegativeInteger, SMPF) -> SMPF

if Coef has "*": (Expon,Coef) -> Coef then

Was not aware that both "*" and _* are allowed for infix functions.



Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

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


[fricas-devel] New domains FiniteSet / OneToN

2018-06-30 Thread Prof. Dr. Johannes Grabmeier privat
Hi all,
since long I have a domain which respresents the elements of a list as a
elements of the domain: FiniteSet(S, List S) and a special case OneToN =
{1,2,3,...,n}.

Two problems:

1. < of PartialOrder does not work properly. Note, that the order of the
elements in the finite set is the given order in the list.

2. OneToN: my attempts to make it as comfortable for the user by using
as underlying domain PositiveInteger gives an error message:

(14) -> enumerate()$Q10

   >> System error:
   The value
  #:G2267
is not of type
  LIST

Using Integer instead gives confusion for coercing from positive
integers to OneToN by missing retractIfCan, but could not be identified,
what the system means.
Is the list argument ln a problem?


If the problems can be fixed, the domains could go into the system.

-- Here is an example computation:


FS4 := FiniteSet(Integer, [2,1,3,4])


   (1)  FiniteSet(Integer,[2,1,3,4])

 
Type: Type
eFS4 := enumerate()$FS4


   (2)  [2, 1, 3, 4]
    Type:
List(FiniteSet(Integer,[2,1,3,4]))
a : FS4 := first eFS4


   (3)  2
  Type:
FiniteSet(Integer,[2,1,3,4])
b : FS4 := second eFS4


   (4)  1
  Type:
FiniteSet(Integer,[2,1,3,4])
a <= b


   (5)  true

  
Type: Boolean
b <= a


   (6)  false

  
Type: Boolean
a < b


   (7)  false

  
Type: Boolean
"in the interpreter this is true, in accordance with the implementation
of <= in the domain!"


   (8)  "in the interpreter this is true, in accordance with the
implementation of <= in the domain!"

   
Type: String
(a <= b) and not(b <= a)


   (9)  true

  
Type: Boolean
Q10 := OneToN 10


   (10)  OneToN(10)

 
Type: Type
enumerate()$Q10


   >> System error:
   The value
  #:G2456
is not of type
  LIST


-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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.
)co finiteSet
FS4 := FiniteSet(Integer, [2,1,3,4])
eFS4 := enumerate()$FS4
a : FS4 := first eFS4
b : FS4 := second eFS4
a <= b
b <= a
a < b
"in the interpreter this is true, in accordance with the implementation of <= 
in the domain!"
(a <= b) and not(b <= a)
Q10 := OneToN 10
enumerate()$Q10
)abbrev domain FINSET FiniteSet
)abbrev domain OTN OneToN

++ Authors: Johannes Grabmeier
++ Date Created: 2010-08-29
++ Date Last Updated: 
++   2018-06-29 JG
++   2014-01-03 JG
++ Basic Operations: 
++ Related Constructors: Finite, SetCategory
++ Also See: 
++ AMS Classifications:
++ Keywords:
++ Reference: 
++ Description: FiniteSet(S: SetCategory, lS: List S) represents the domain of 
++   the elements of the given list. The ordering in lS defines the total order 
++   on %. Note, that multiple entries in lS are removed.
FiniteSet(S: SetCategory, lS: List S): public == private where
  public ==> Join(SetCategory, Finite, StepThrough, 
OrderedFinite, RetractableFrom S, CoercibleFrom S)--, RetractableTo S)
  private ==> S add

-- representation of the object:

Rep := S
rep(s : %) : Rep == s @ Rep
per(rp : Rep) : % == rp @ %

-- import of domains and packages

import OutputForm

-- local variables

lS := removeDuplicates! lS
n : NonNegativeInteger := #lS

[fricas-devel] $resolve_level is unbound

2018-06-26 Thread Prof. Dr. Johannes Grabmeier privat
Good morning,

any idea what that means (used to work before):


   >> System error:
   The variable |$resolve_level| is unbound.

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

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


[fricas-devel] sqrt for prime fields

2018-06-10 Thread Prof. Dr. Johannes Grabmeier privat
Hi all,

have added sqrt for prime fields, perhaps for next release.

(1) -> )r sqrtpf
F := PrimeField(nextPrime 273845092384750923487509234587)


   (1)  PrimeField(273845092384750923487509234619)

 
Type: Type
x : F := 78345093845709384750923478509238475


   (2)  203675171223548534986558619527
    Type:
PrimeField(273845092384750923487509234619)
y := sqrt x


   (3)  86011080573889143280363302745
    Type:
PrimeField(273845092384750923487509234619)
y^2-x


   (4)  0
    Type:
PrimeField(273845092384750923487509234619)
x : F := 8596703498567034985679679876


   (5)  8596703498567034985679679876
    Type:
PrimeField(273845092384750923487509234619)
y := sqrt x


   (6)  53436731848479301994740043535
    Type:
PrimeField(273845092384750923487509234619)
y^2-x


   (7)  0
    Type:
PrimeField(273845092384750923487509234619)
x : F := 8596703498567034985679


   (8)  8596703498567034985679
    Type:
PrimeField(273845092384750923487509234619)
y := sqrt x


   >> Error detected within library code:
   sqrt: argument does not have a square root by Jacobi symbol.

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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.
)abbrev domain IPF InnerPrimeField
++ Authors: N.N., J.Grabmeier, A.Scheerhorn
++ Date Created: ?, November 1990, 26.03.1991
++   Revision 05.06.2018 by J. Grabmeier
++ Basic Operations:
++ Related Constructors: PrimeField
++ Also See:
++ AMS Classifications:
++ Keywords: prime characteristic, prime field, finite field
++ References:
++  R.Lidl, H.Niederreiter: Finite Field, Encycoldia of Mathematics and
++  Its Applications, Vol. 20, Cambridge Univ. Press, 1983, ISBN 0 521 30240 4
++  J. Grabmeier, A. Scheerhorn: Finite Fields in Axiom.
++   Axiom Technical Report Series, ATR/5 NP2522.
++  K. Pommerening: lectures on Cryptology, 
http://www.staff.uni-mainz.de/pommeren/Cryptology
++ Description:
++   InnerPrimeField(p) implements the field with p elements by using 
IntegerMod p.
++   Note: argument p MUST be a prime (this domain does not check).
++   See \spadtype{PrimeField} for a domain that does check.
++   In addition to the herited operations of IntegerMod p, the domain 
++   provides exploits the structure of the cyclic group of its invertible 
elements.
++   It stores a primitive element w, i.a. generator of this group and it 
stores a
++   logarithm table for w as soon as this is required.
++   sqrt was added in 2018.

InnerPrimeField(p : PositiveInteger) : Exports == Implementation where

  I   ==> Integer
  NNI ==> NonNegativeInteger
  PI  ==> PositiveInteger
  TBL ==> Table(PI, NNI)
  R   ==> Record(key : PI, entry : NNI)
  SUP ==> SparseUnivariatePolynomial
  OF  ==> OutputForm

  Exports ==> Join(FiniteFieldCategory, FiniteAlgebraicExtensionField(%), _
ConvertibleTo(Integer)) with 
sqrt : % -> %
  ++ sqrt(x) computes one y such that y^2 = x, error if there is no 
  ++ square root, i.e. jacobi(x,p) = -1.
  ++ Implementation according to 
  ++ http://www.staff.uni-mainz.de/pommeren/Cryptology/Asymmetric/5_NTh/
quadraticNonResidue: () ->  %
  ++ quadraticNonResidue() computes the smallest non negative integer, 
  ++ which represents a quadratic non residue.

  Implementation ==> IntegerMod p add
-- local variables 
primitiveElementNotPresent? : Boolean := true
-- gets false after initialization of the primitive Element.
primitiveElt : PI := 1
-- primitiveElt stores a primitive element as soon as it is computed by 
-- createPrimitiveElement().
cyclicGroupSize : NNI := qcoerce(p-1)@NNI
-- the size of the cyclic group of invertible elements.
factorsOfCyclicGroupSize: List Record(factor : Integer, exponent : Integer) 
:= []
-- will hold the factorization of the cyclic group size of the group of
-- invertible elements, as soon as the logarithm tables are required.
logarithmTableNotPresent? : Boolean := true
-- gets false after 

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

2018-05-31 Thread Prof. Dr. Johannes Grabmeier privat


Am 31.05.18 um 15:55 schrieb Erik Eidsvig:
> Thanks!
>
> -But what about n-root of a numer? As an example, the 5th-root of 32?
>
> (I have tried commands like root(32,5), nrot(32,5) etc.)

(1) -> nthRoot(5,7)

    7+-+
   (1)  \|5
  
Type: AlgebraicNumber
(2) -> nthRoot(5.0,7)

   (2)  1.2584989506_41826735


Type: Float





>
>
>
> -The angle between two vectors?
> (For example [2,3] and [-3,4])

(4) -> v := vector [2,3]

   (4)  [2, 3]
  
Type: Vector(PositiveInteger)

(5) -> length v

 +--+
   (5)  \|13
  
Type: AlgebraicNumber
(6) -> w := vector [-3,4]

   (6)  [- 3, 4]
  
Type: Vector(Integer)
(7) -> length w

   (7)  5
  
Type: AlgebraicNumber
(8) -> angle(v,w) == acos( dot(v,w) / length(v) / length(w))

 
Type: Void
(9) -> angle(v,w)
   Compiling function angle with type (Vector(PositiveInteger),
Vector(Integer)) -> Expression
  (Integer)

    +--+
 6 \|13
   (9)  acos(---)
    65
  
Type: Expression(Integer)
(10) -> numeric %

   (10)  1.2315037123_40851938



>
>
> -If I know the x-value of the function, is it possible to make Axiom
> find the tangent line in this point?
>
> (Something like this:(1) -> f(x)==2*x^4-2*x^2
>                                                                  
>  Type: Void
> (2) -> Tangent(1, f(x))
>    Compiling function f with type Variable(x) -> Polynomial(Integer)
>    There are no library operations named Tangent
>       Use HyperDoc Browse or issue
>                               )what op Tangent
>       to learn if there is any operation containing " Tangent " in its
>       name.
>
>    Cannot find a definition or applicable library operation named
>       Tangent with argument type(s)
>                                PositiveInteger
>                              Polynomial(Integer)
>
>       Perhaps you should use "@" to indicate the required return type,
>       or "$" to specify which version of the function you need.
>


(18) -> f := 2*x^4-2*x^2

    4  2
   (18)  2 x  - 2 x
  
Type: Polynomial(Integer)
(19) -> tangent(f,x0) == eval(D(f,x),x=x0)*x - eval(f,x=x0) -
eval(D(f,x),x=x0)*x0
   1 old definition(s) deleted for function or rule tangent

 
Type: Void
(20) -> tangent(f,1)
   Compiling function tangent with type (Polynomial(Integer),
PositiveInteger) -> Polynomial(
  Integer)

   (20)  4 x - 4
  
Type: Polynomial(Integer)




>
> -Is it possible to find the (shortest) distance between the line and a
> point? 
>
> (For example the distance between the line 3x-4 and the point (6,4))





>
>
> -The lenght of a vector?
>
> For example the length of [2,3]
>
> -- 
> You received this message because you are subscribed to the Google
> Groups "FriCAS - computer algebra system" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to fricas-devel+unsubscr...@googlegroups.com
> .
> To post to this group, send email to fricas-devel@googlegroups.com
> .
> Visit this group at https://groups.google.com/group/fricas-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

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


[fricas-devel] how to remove "failed"?

2018-05-26 Thread Prof. Dr. Johannes Grabmeier privat
What is going wrong here:

(1) -> li := [2,4,3,2,5,2,7,2,2,7]

   (1)  [2, 4, 3, 2, 5, 2, 7, 2, 2, 7]

Type: List(PositiveInteger)
(2) -> remove(2,li)

   (2)  [4, 3, 5, 7, 7]

Type: List(PositiveInteger)
(3) -> li10 := [recip(i::IntegerMod 10) for i in 0..9]

   (3)  ["failed", 1, "failed", 7, "failed", "failed", "failed", 3,
"failed", 9]
  Type:
List(Union(IntegerMod(10),"failed"))
(4) -> f : Union(IntegerMod(10),"failed") := "failed"

   (4)  "failed"
  
Type: Union("failed",...)
(5) -> remove(f, li10)
   There are 3 exposed and 1 unexposed library operations named remove
having 2 argument(s)
  but none was determined to be applicable. Use HyperDoc Browse, or
issue
 )display op remove
  to learn more about the available operations. Perhaps
package-calling the operation or
  using coercions on the arguments will allow you to apply the
operation.

   Cannot find a definition or applicable library operation named remove
with argument type(s)

   failed
    List(Union(IntegerMod(10),"failed"))

  Perhaps you should use "@" to indicate the required return type,
or "$" to specify which
  version of the function you need

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

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


[fricas-devel] Interrupt keys on MacBook FriCAS 1.3.3 on SBCL

2018-04-09 Thread Prof. Dr. Johannes Grabmeier privat
Can anyone help: What are the interrupt key combination to stop a
running FriCAS computation on MacBook FriCAS  1.3.3 on  SBCL?

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

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


[fricas-devel] "has"

2018-03-30 Thread Prof. Dr. Johannes Grabmeier privat
Can one clarify the ideas, semantics behind the following behaviours?


FriCAS algebra code:

AbelianMonoid() : Category == AbelianSemiGroup with
  0 : constant -> %
  .

becomes the following in the Interpreter:

(87) -> )sh AbelianMonoid
 AbelianMonoid is a category constructor
 Abbreviation for AbelianMonoid is ABELMON
 This constructor is exposed in this frame.
--- Operations
---

 ?*? : (NonNegativeInteger, %) -> %    ?*? :
(PositiveInteger, %) -> %
 ?+? : (%, %) -> % ?=? : (%, %) -> Boolean
 0 : () -> %   coerce : % -> OutputForm


The following code compiles

if R has 0: () -> % then CoercibleFrom Bits

while

if R has 0: constant -> % then CoercibleFrom Bits

does not compile


The compiled variant, however, cannot be used for R = Integer
as

(87) -> Integer has AbelianMonoid

   (87)  true

  
Type: Boolean
(88) -> Integer has 0: () -> %

   (88)  false

  
Type: Boolean
(89) -> Integer has 0: constant -> %

   constant is not a valid type.



In my opinion the behaviour is not what one expects, what has to be
changed, to get forseeable
behaviour?

Remark: I remember that constant and () once distinguished between
constant values and constant functions,
but this seems to be no longer the case.

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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] leftRecip and rightRecip

2018-02-02 Thread Prof. Dr. Johannes Grabmeier privat
you are absolutely right, this argument was to quick and unprecise, I
have to confess - after all, it was R. Wisbauer and myself who designed
and implemented
non-associative structures ages ago in 1991 and added recip to
MagmaWithUnit (which was called MonadWithUnit at that time)

So my remark shoud better read:

All general functions as leftRecip and rightRecip and associator are 
superfluous as
soon as we have an associative structure, also it should not disappear

I hope, however, you agree with the intensions of my comment.


Am 02.02.18 um 19:54 schrieb Bill Page:
> On Fri, Feb 2, 2018 at 3:53 AM, Prof. Dr. Johannes Grabmeier privat
> <johan...@grabmeier.net> wrote:
>> All general functions as leftRecip and rightRecip are superfluous as
>> soon we have a recip, ...
> I don't think so. For example 'MagmaWithUnit' is inherited by a very
> large number of domains. It exports 'leftRecip' and 'rightRecip' as
> well as 'recip'. The intended semantics is that, for all x, if
> 'recip(x)' is not "failed" then 'leftRecip(x) = rightRecip(x) =
> recip(x)'. However if 'recip(x)' is "failed" then separate left and/or
> right inverses of x might independently still exist. To make
> 'leftRecip' and 'rightRecip' superfluous requires an additional
> assumption but this could be the default assumption implemented in
> 'MagmaWithUnit'.
>
> diff --git a/src/algebra/naalgc.spad b/src/algebra/naalgc.spad
> index a9209da..9ae411f 100644
> --- a/src/algebra/naalgc.spad
> +++ b/src/algebra/naalgc.spad
> @@ -112,6 +112,8 @@ MagmaWithUnit() : Category == Magma with
>recip x ==
>(x = 1) => x
>"failed"
> +  leftRecip(x) == recip(x)
> +  rightRecip(x) == recip(x)
>

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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] leftRecip and rightRecip

2018-02-02 Thread Prof. Dr. Johannes Grabmeier privat
Your discussion showa a problem which disturbs me since long: In
AXIOM/FriCAS we are try to be as general as possible, having
non-associative and non-commutation structure. Every commutative
structure is a special case of the general non-(neccesarily)
commuatative structure, every associative structure is a special case of
the general non-(neccesarily) commutative structure and so on. This make
it complicated for new users, because they get hundreds of functions and
might have no clue, what is important and what is not.

All general functions as leftRecip and rightRecip are superfluous as
soon we have a recip, associator is superfluous as soon we have an
associative structure, also it should not disappear. My suggestion to
help the novices to use FriCAS is that at least for the )show command we
should have some mechanism to hide such functions. 
Another example is D - operator for finite fields, which always gives 0
and so on. 

Suggestion for the compiler-language:

with
   ...
hide
   ...

with only labelling these functions as "hided", - but of course for
consistency, being usable, if one has to, e.g. for validity of general
algorithms.

Would this be difficult to implement? We also should have a concept for
a standard way in every domain to generate elements and so on. All
effords to make FriCAS easier to use.


Johannes


Am 02.02.18 um 08:34 schrieb oldk1331:
> On Fri, Feb 2, 2018 at 2:42 PM, Ralf Hemmecke  wrote:
>> On 02/01/2018 02:46 AM, oldk1331 wrote:
>>> We can add default implementation of 'leftRecip', 'rightRecip'
>>> to be 'recip' in Group.
>> The patch
>>
>> https://github.com/hemmecke/fricas/commit/a9a7c7d72cdc2a7e3527a505c675ee3b09fcbb05
>>
>> https://github.com/hemmecke/fricas/commit/a9a7c7d72cdc2a7e3527a505c675ee3b09fcbb05.patch
>>
>> looks fine to me, but I think, it should be extended, because it doesn't
>> solve my original problem with Fraction Integer.
>>
>> In fact, we should at least implement left/rightRecip in each place
>> where recip or inv is implemented. DivisionRing is, for example, such a
>> candidate. I have, however, not yet done a complete search for all such
>> candidates.
>>
>> Ralf
> I suppose CommutativeRing is the right place.
>

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

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


[fricas-devel] Strang output bug for summed overlines

2017-09-29 Thread Prof. Dr. Johannes Grabmeier privat
In statement 2 (combination of overbar and +) the line wraps cause that
the 3 characters  '  , ; and O disappear, changing the output length
appropriately, all is ok.

Any idea to fix this?  print of OutputForm calls mathprint of Lisp.

I discovered that for proper output of negations of boolean expressions


)set output length 80

ob := [overbar(index(i)$CHAR::OutputForm) for i in 40..90]


   (1)
_  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _ 
_  _  _
   [', (, ), *, +, ,, -, ., /, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =,
>, ?, @,
_  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _ 
_  _
A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W,
X, Y]
  Type:
List(OutputForm)
rob := reduce(+,ob)


   (2)
 _   _   _   _   _   _   _   _   _   _   _   _   _   _   _   _   _  
_   _   _
   + ( + ) + * + + + , + - + . + / + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 +
8 + 9 + :
   +
 _   _   _   _   _   _   _   _   _   _   _   _   _   _   _   _   _  
_   _   _
   + < + = + > + ? + @ + A + B + C + D + E + F + G + H + I + J + K +
L + M + N
   +
 _   _   _   _   _   _   _   _   _   _   _
   + P + Q + R + S + T + U + V + W + X + Y
Type:
OutputForm
)set output length 210

rob


_   _   _   _   _   _   _   _   _   _   _   _   _   _   _   _  
_   _   _   _   _   _   _   _   _   _   _   _   _   _   _   _   _   _  
_   _   _   _   _   _   _   _   _   _   _   _   _   _   _   _   _
   (3)  ' + ( + ) + * + + + , + - + . + / + 0 + 1 + 2 + 3 + 4 + 5 + 6 +
7 + 8 + 9 + : + ; + < + = + > + ? + @ + A + B + C + D + E + F + G + H +
I + J + K + L + M + N + O + P + Q + R + S + T + U + V + W + X + Y


 
Type: OutputForm


-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

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


[fricas-devel] Semantics of _ and ".." and Boolean functions

2017-09-24 Thread Prof. Dr. Johannes Grabmeier privat
Can someone explain to me the semantics of "..." and _"


E.g. BitAggregate:

BitAggregate() : Category ==
  Join(OrderedSet, Logic, OneDimensionalArrayAggregate Boolean) with
"not": % -> %
  ++ not(b) returns the logical {\em not} of bit aggregate
  ++ \spad{b}.
nand : (%, %) -> %
  ++ nand(a, b) returns the logical {\em nand} of bit aggregates
\spad{a}
  ++ and \spad{b}.
nor  : (%, %) -> %
  ++ nor(a, b) returns the logical {\em nor} of bit aggregates
\spad{a} and
  ++ \spad{b}.
_and : (%, %) -> %
  ++ a and b returns the logical {\em and} of bit aggregates
\spad{a} and
  ++ \spad{b}.
_or  : (%, %) -> %
  ++ a or b returns the logical {\em or} of bit aggregates \spad{a} and
  ++ \spad{b}.
xor  : (%, %) -> %
  ++ xor(a, b) returns the logical {\em exclusive-or} of bit aggregates
  ++ \spad{a} and \spad{b}.

 add
   not v  == map(_not, v)
   _~(v)  == map(_~, v)
   _/_\(v, u) == map(_/_\, v, u)
   _\_/(v, u) == map(_\_/, v, u)
   nand(v, u) == map(nand, v, u)
   nor(v, u)  == map(nor, v, u)


I thought ".." means infix, here obviously not!



Writing an own category as follows in this fashing fails:

)abbrev category BFC BooleanFunctionCategory
BooleanFunctionCategory(): Category == BasicType with
"not" : % -> %
_and : (%, %) -> %
nand : (%, %) -> %
_or : (%, %) -> %
xor : (%, %) -> %
implies : (%, %) -> %
equiv : (%, %) -> %
  add
nand(x: %, y: %): % ==  _not(_and(x,y))
xor(x: %, y: %): % == _or( _and(_not(x), y), _and(x, _not(y)) )
equiv(x: %, y: %): % == _and(implies(x,y), implies(y,x))
implies(x: %, y: %): % == _or(_not(x),y)


with following error messages:

   BFC abbreviates category BooleanFunctionCategory

   initializing NRLIB BFC for BooleanFunctionCategory
   compiling into NRLIB BFC

;;; ***   |BooleanFunctionCategory| REDEFINED
WARNING: redefining BOOT::|BooleanFunctionCategory| in DEFUN
WARNING: redefining BOOT::|BooleanFunctionCategory;| in DEFUN
Time: 0.00 SEC.

   BFC- abbreviates domain BooleanFunctionCategory&

   initializing NRLIB BFC- for BooleanFunctionCategory&
   compiling into NRLIB BFC-
   compiling exported nand : (S,S) -> S
** comp fails at level 2 with expression: **
error in function nand

(IF | << x >> |
(IF |y|
|false|
|true|)
|true|)
** level 2  **
$x:= x
$m:= (Boolean)
$f:=
|y| # . #1=#) (|x| # #) (|y| . #1#) (|$Information| #) ...)))

   >> Apparent user error:
   Cannot coerce x
  of mode S
  to mode (Boolean)



-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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] The function BOOT::|#| is undefined.

2017-09-19 Thread Prof. Dr. Johannes Grabmeier privat
Thanks a lot for your quick help, yes I was not quite concentrated, in
the model GDMP one has

E : DirectProductCategory(#vl, NonNegativeInteger)

hence an argument of the domain constructor, while I had

E==> TermDisjunctiveNormalForm(#vl)

hence only at runtime, also it is very subtle, that one can not specify such a 
value in this way. 

After having added the missing functions, the next problem immediately occured:

(24) -> monomial(1,t)$D3


   >> System error:
   The value
  2
is not of type
  CONS

Now, I tried to eliminate all the concrete 2's, adding superfluous parameter p: 
PositiveInteger (and the problem, that one
can now instantiate with wrong numbers!) Which did not help at all: again:

(22) -> d : D3 := monomial(1,t)


   >> System error:
   The value
  2
is not of type
  CONS


My next suspection was my "strange" implementation with
OnePointCompletion for TermDisjunctiveNormalForm. But that is ok, as it
works by using the domain
PolynomialRIng was perfect well:

24) -> P := PolynomialRing(EV, T)

   (24) 
PolynomialRing(PRestrictedInteger(2),TermDisjunctiveNormalForm(2,3))

 
Type: Type
(25) -> monomial(1,t)$P

   (25)  [0,1,1]
  Type:
PolynomialRing(PRestrictedInteger(2),TermDisjunctiveNormalForm(2,3))


This kind of problems really make it sometimes annoying in coding in
AXIOM/FriCAS.

I basically modified (for a more general use) three polynomial
categories to have more general exponents (p-restricted integers) and
more or less coded
a different output form and then one has to fight hours with these kind
of problems.


I send the actual files and hope for another help. In any case thanks a lot!




Am 19.09.17 um 16:17 schrieb oldk1331:
> I think the bug happens here:
>
> DisjunctiveNormalForm(vl: List Symbol) : public == private where
>   EV   ==> PRestrictedInteger(2)
>   E==> TermDisjunctiveNormalForm(#vl)
>
> I think the "#vl" is a runtime value and compiler can't handle that,
> change it to:
>
> DisjunctiveNormalForm(vl: List Symbol, dim : NonNegativeInteger) :
> public == private where
>   EV   ==> PRestrictedInteger(2)
>   E==> TermDisjunctiveNormalForm(dim)
>
> And in test file use "D3:=DisjunctiveNormalForm(vl, #vl)".
> Then this bug disappears and runs into a missing implementation.
>
> d : D3 := monomial(1,t)
>
> Function:  ?.? : (%, Integer) -> PRestrictedInteger(2) is missing from
> domain: TermDisjunctiveNormalForm(3)
>Internal Error
>The function elt with signature (PRestrictedInteger 2)$(Integer) is
> missing from domain TermDisjunctiveNormalForm3
>

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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.
)if false
)abbrev domain ORDCOMP OrderedCompletion
++ Completion with + and - infinity
++ Author: Manuel Bronstein
++ Description: Adjunction of two real infinites quantities to a set.
++ Date Created: 4 Oct 1989
OrderedCompletion(R : SetCategory) : Exports == Implementation where
  B ==> Boolean

  Exports ==> Join(SetCategory, FullyRetractableTo R) with
plusInfinity : () -> %++ plusInfinity() returns +infinity.
minusInfinity : () -> %++ minusInfinity() returns  -infinity.
finite?  : %  -> B
  ++ finite?(x) tests if x is finite.
infinite?: %  -> B
  ++ infinite?(x) tests if x is +infinity or -infinity,
whatInfinity : %  -> SingleInteger
  ++ whatInfinity(x) returns 0 if x is finite,
  ++ 1 if x is +infinity, and -1 if x is -infinity.
if R has AbelianMonoid then
  _+ : (%, %) -> %
if R has AbelianGroup then
  _- : % -> %
if R has OrderedSet then OrderedSet
if R has IntegerNumberSystem then
  rational? : % -> Boolean
++ rational?(x) tests if x is a finite rational number.
  rational : % -> Fraction Integer
++ rational(x) returns x as a finite rational number.
++ Error: if x cannot be so converted.
  rationalIfCan : % -> Union(Fraction Integer, "failed")
++ rationalIfCan(x) returns x as a finite rational number if
++ it is one and "failed" otherwise.

  Implementation ==> add
Rep := Union(fin : R, inf : B)  -- true = +infinity, false = -infinity

coerce(r : R) : %  == [r]
retract(x:%):R == (x case fin => x.fin; error "Not finite")
finite? x  == x case fin

Re: [fricas-devel] The function BOOT::|#| is undefined.

2017-09-19 Thread Prof. Dr. Johannes Grabmeier privat
here they are

)r compile-all

  1 )co iml
  2 )co prest
  3 )co complet
  4 )co dnf
  5 )r testdnf


Am 19.09.17 um 15:00 schrieb oldk1331:
> The bug probably exists in your code instead of the compiler,
> so please upload your souce file, especially the definition
> of DisjunctiveNormalForm.
>

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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.
vl := [p1,p2,p3]
n := #vl
T := TermDisjunctiveNormalForm(n)
EV := PRSTINT(2)
E  := PRDPINT(2,n)
t : T := directProduct vector [0,1,1]
t' : T := directProduct vector [1,-1,0]
t+t
t'+t'
t+t'
sup(t, t')

D3:=DisjunctiveNormalForm vl

u : D3 := 0
d : D3 := monomial(1,t)

)fin
u : D := 1


)r testDPRMP
--F := PF 2 
F := PRestricted 2
vl : List Symbol := ['p,'q,'r] --[Kpa, Kdu, Kde, Kbl, Ppa, Pdu, Pde, Pbl, Bpa, 
Bdu, Bde, Bbl, Dpa, Ddu, Dde, Dbl]
--P := DNF([Kpa, Kdu, Kde, Kbl, Ppa, Pdu, Pde, Pbl, Bpa, Bdu, Bde, Bbl, Dpa, 
Ddu, Dde, Dbl], F)
)read i-funsel.boot
)co iml
)co prdp
)co prdp
)co prdp
)r testDPRMP
)sh UnittestCount
)sh UnittestAux
)sh Unittest
t : T := [1,1,1] pretend T
t : T := [1,1,-1] pretend T
)r testDPRMP
--F := PF 2 
F := PRestricted 2
vl : List Symbol := ['p,'q,'r] --[Kpa, Kdu, Kde, Kbl, Ppa, Pdu, Pde, Pbl, Bpa, 
Bdu, Bde, Bbl, Dpa, Ddu, Dde, Dbl]
--P := DNF([Kpa, Kdu, Kde, Kbl, Ppa, Pdu, Pde, Pbl, Bpa, Bdu, Bde, Bbl, Dpa, 
Ddu, Dde, Dbl], F)
T := TermDisjunctiveNormalForm(2,#vl)
s : T := random()
)r testDPRMP
--F := PF 2 
F := PRestricted 2
vl : List Symbol := ['p,'q,'r] --[Kpa, Kdu, Kde, Kbl, Ppa, Pdu, Pde, Pbl, Bpa, 
Bdu, Bde, Bbl, Dpa, Ddu, Dde, Dbl]
--P := DNF([Kpa, Kdu, Kde, Kbl, Ppa, Pdu, Pde, Pbl, Bpa, Bdu, Bde, Bbl, Dpa, 
Ddu, Dde, Dbl], F)
T := TermDisjunctiveNormalForm(2,#vl)
s : T := random()
--3*s
t : T := random()
)r test
--F := PF 2 
F := PRestricted 2
vl : List Symbol := ['p,'q,'r] --[Kpa, Kdu, Kde, Kbl, Ppa, Pdu, Pde, Pbl, Bpa, 
Bdu, Bde, Bbl, Dpa, Ddu, Dde, Dbl]
--P := DNF([Kpa, Kdu, Kde, Kbl, Ppa, Pdu, Pde, Pbl, Bpa, Bdu, Bde, Bbl, Dpa, 
Ddu, Dde, Dbl], F)
T := TermDisjunctiveNormalForm(2,#vl)
s : T := random()
--3*s
t : T := random()
--t*(-5) -- should - result in [-t1, -t2, ...]?
s,t
)r testDPRMP
--F := PF 2 
F := PRestricted 2
vl : List Symbol := ['p,'q,'r] --[Kpa, Kdu, Kde, Kbl, Ppa, Pdu, Pde, Pbl, Bpa, 
Bdu, Bde, Bbl, Dpa, Ddu, Dde, Dbl]
--P := DNF([Kpa, Kdu, Kde, Kbl, Ppa, Pdu, Pde, Pbl, Bpa, Bdu, Bde, Bbl, Dpa, 
Ddu, Dde, Dbl], F)
T := TermDisjunctiveNormalForm(2,#vl)
s : T := random()
--3*s
t : T := random()
--t*(-5) -- should - result in [-t1, -t2, ...]?
s,t
)r testDPRMP
--F := PF 2 
F := PRestricted 2
vl : List Symbol := ['p,'q,'r] --[Kpa, Kdu, Kde, Kbl, Ppa, Pdu, Pde, Pbl, Bpa, 
Bdu, Bde, Bbl, Dpa, Ddu, Dde, Dbl]
--P := DNF([Kpa, Kdu, Kde, Kbl, Ppa, Pdu, Pde, Pbl, Bpa, Bdu, Bde, Bbl, Dpa, 
Ddu, Dde, Dbl], F)
T := TermDisjunctiveNormalForm(2,#vl)
s : T := random()
--3*s
t : T := random()
--t*(-5) -- should - result in [-t1, -t2, ...]?
s,t
)r testDPRMP
--F := PF 2 
F := PRestricted 2
vl : List Symbol := ['p,'q,'r] --[Kpa, Kdu, Kde, Kbl, Ppa, Pdu, Pde, Pbl, Bpa, 
Bdu, Bde, Bbl, Dpa, Ddu, Dde, Dbl]
--P := DNF([Kpa, Kdu, Kde, Kbl, Ppa, Pdu, Pde, Pbl, Bpa, Bdu, Bde, Bbl, Dpa, 
Ddu, Dde, Dbl], F)
T := TermDisjunctiveNormalForm(2,#vl)
s : T := random()
--3*s
t : T := random()
--t*(-5) -- should - result in [-t1, -t2, ...]?
s,t
)r testDPRMP
--F := PF 2 
F := PRestricted 2
vl : List Symbol := ['p,'q,'r] --[Kpa, Kdu, Kde, Kbl, Ppa, Pdu, Pde, Pbl, Bpa, 
Bdu, Bde, Bbl, Dpa, Ddu, Dde, Dbl]
--P := DNF([Kpa, Kdu, Kde, Kbl, Ppa, Pdu, Pde, Pbl, Bpa, Bdu, Bde, Bbl, Dpa, 
Ddu, Dde, Dbl], F)
T := TermDisjunctiveNormalForm(2,#vl)
s : T := random()
--3*s
t : T := random()
--t*(-5) -- should - result in [-t1, -t2, ...]?
s,t
)r testDPRMP
--F := PF 2 
F := PRestricted 2
vl : List Symbol := ['p,'q,'r] --[Kpa, Kdu, Kde, Kbl, Ppa, Pdu, Pde, Pbl, Bpa, 
Bdu, Bde, Bbl, Dpa, Ddu, Dde, Dbl]
--P := DNF([Kpa, Kdu, Kde, Kbl, Ppa, Pdu, Pde, Pbl, Bpa, Bdu, Bde, Bbl, Dpa, 
Ddu, Dde, Dbl], F)
T := TermDisjunctiveNormalForm(2,#vl)
s : T := random()
--3*s
t : T := random()
--t*(-5) -- should - result in [-t1, -t2, ...]?
s,t
--sup(s,t)
--s-t
s' : T := directProduct [0,1,1]
t' : T := directProduct [1,0,-1]
and'(s', t')
s'' : T := directProduct [-1,0,1]
)r testDPRMP
--F := PF 2 
F := PRestricted 2
vl : List Symbol := ['p,'q,'r] --[Kpa, Kdu, Kde, Kbl, Ppa, Pdu, Pde, Pbl, Bpa, 
Bdu, Bde, Bbl, Dpa, Ddu, Dde, Dbl]
--P := DNF([Kpa, Kdu, Kde, Kbl, Ppa, Pdu, Pde, Pbl, 

Re: [fricas-devel] The function BOOT::|#| is undefined.

2017-09-19 Thread Prof. Dr. Johannes Grabmeier privat
code is a lot of stuff, have basically more or less rewritten and
generalized the polynomials.

So I try the backtrace

(180) -> D3 := DisjunctiveNormalForm [p1,p2,p3]

   (180)  DisjunctiveNormalForm([p1,p2,p3])

 
Type: Type
(181) -> )sh D3

debugger invoked on a UNDEFINED-FUNCTION in thread
#:
  The function BOOT::|#| is undefined.

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

(no restarts: If you didn't do this on purpose, please report it as a bug.)

("undefined function")
0] backtrace

Backtrace for: #
0: ("undefined function")
1: (|DisjunctiveNormalForm;| (|p1| |p2| |p3|))
2: (|DisjunctiveNormalForm| (|p1| |p2| |p3|))
3: (SB-EVAL:EVAL-IN-NATIVE-ENVIRONMENT (|DisjunctiveNormalForm| (QUOTE
(|p1| |p2| |p3|))) #)
4: (EVAL (|DisjunctiveNormalForm| (QUOTE (|p1| |p2| |p3|
5: (|eval| (|DisjunctiveNormalForm| (QUOTE (|p1| |p2| |p3|
6: (|evalDomain| (|DisjunctiveNormalForm| (|p1| |p2| |p3|)))
7: (|reportOpsFromUnitDirectly| (|DisjunctiveNormalForm| (|p1| |p2| |p3|)))
8: (|reportOperations| # D3)
9: (|showSpad2Cmd| (D3))
10: (|show| (D3))
11: (|systemCommand| ((|sh| D3)))
12: (|doSystemCommand| #)
13: (|ExecuteInterpSystemCommand| #)
14: (|InterpExecuteSpadSystemCommand| ")sh D3")
15: (|ncloopCommand| ")sh D3" 2)
16: (|intloopReadConsole| # 2)
17: (|SpadInterpretStream| 1 (TIM DALY ?) T)
18: (|intloop|)
19: (|ncTopLevel|)
20: (|runspad|)
21: (|spad|)
22: (FRICAS-RESTART)
23: ((LAMBDA NIL :IN FRICAS-LISP::SAVE-CORE-RESTART))
24: ((FLET #:WITHOUT-INTERRUPTS-BODY-77 :IN SB-EXT:SAVE-LISP-AND-DIE))
25: ((LABELS SB-IMPL::RESTART-LISP :IN SB-EXT:SAVE-LISP-AND-DIE))

0]
u : D3 := 0

Top of stack.
0] top


debugger invoked on a SB-INT:SIMPLE-CONTROL-ERROR in thread
#:
  attempt to THROW to a tag that does not exist: SB-INT:TOPLEVEL-CATCHER

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Reduce debugger level (to debug level 1).

(SB-C:UNWIND)
0[2] (top)
; No debug variables for current frame: using EVAL instead of EVAL-IN-FRAME.
(181) -> u : D3 := 0

debugger invoked on a UNDEFINED-FUNCTION in thread
#:
  The function BOOT::|#| is undefined.

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

(no restarts: If you didn't do this on purpose, please report it as a bug.)

("undefined function")
0] backtrace

Backtrace for: #
0: ("undefined function")
1: (|DisjunctiveNormalForm;| (|p1| |p2| |p3|))
2: (|DisjunctiveNormalForm| (|p1| |p2| |p3|))
3: (SB-EVAL:EVAL-IN-NATIVE-ENVIRONMENT (|DisjunctiveNormalForm| (QUOTE
(|p1| |p2| |p3|))) #)
4: (EVAL (|DisjunctiveNormalForm| (QUOTE (|p1| |p2| |p3|
5: (|eval| (|DisjunctiveNormalForm| (QUOTE (|p1| |p2| |p3|
6: (|evalDomain| (|DisjunctiveNormalForm| (|p1| |p2| |p3|)))
7: (|interpLookup;| |coerce| ($ (|Integer|)) (|DisjunctiveNormalForm|
(|p1| |p2| |p3|)))
8: (|interpLookup| |coerce| ($ (|Integer|)) (|DisjunctiveNormalForm|
(|p1| |p2| |p3|)))
9: (|coerceByFunction| ((|NonNegativeInteger|) . 0)
(|DisjunctiveNormalForm| (|p1| |p2| |p3|)))
10: (|coerceIntTower| ((|NonNegativeInteger|) . 0)
(|DisjunctiveNormalForm| (|p1| |p2| |p3|)))
11: (|coerceInt1| ((|NonNegativeInteger|) . 0) (|DisjunctiveNormalForm|
(|p1| |p2| |p3|)))
12: (|coerceInt| ((|NonNegativeInteger|) . 0) (|DisjunctiveNormalForm|
(|p1| |p2| |p3|)))
13: (|coerceInt0| ((|NonNegativeInteger|) . 0) (|DisjunctiveNormalForm|
(|p1| |p2| |p3|)))
14: (|coerceInteractive| ((|NonNegativeInteger|) . 0) #)
15: (|coerceOrRetract| ((|NonNegativeInteger|) . 0)
(|DisjunctiveNormalForm| (|p1| |p2| |p3|)))
16: (|getArgValue1| #(|--immediateData--| NIL ((|NonNegativeInteger|) .
0) ((|DisjunctiveNormalForm| (|p1| |p2| |p3|))) ((|target|
|DisjunctiveNormalForm| (|p1| |p2| |p3| (|DisjunctiveNormalForm|
(|p1| |p2| |p3|)))
17: (|getArgValue| #(|--immediateData--| NIL ((|NonNegativeInteger|) .
0) ((|DisjunctiveNormalForm| (|p1| |p2| |p3|))) ((|target|
|DisjunctiveNormalForm| (|p1| |p2| |p3| (|DisjunctiveNormalForm|
(|p1| |p2| |p3|)))
18: (|evalLET| #(|u| (|DisjunctiveNormalForm| (|p1| |p2| |p3|)) NIL NIL
NIL) #(|--immediateData--| NIL ((|NonNegativeInteger|) . 0)
((|DisjunctiveNormalForm| (|p1| |p2| |p3|))) ((|target|
|DisjunctiveNormalForm| (|p1| |p2| |p3|)
19: (|upLET| (#(LET NIL NIL NIL NIL) #(|u| #1=(|DisjunctiveNormalForm|
(|p1| |p2| |p3|)) NIL NIL NIL) #(|--immediateData--| NIL
((|NonNegativeInteger|) . 0) ((|DisjunctiveNormalForm| (|p1| |p2|
|p3|))) ((|target| . #1#)
20: (|bottomUp| (#(LET NIL NIL NIL NIL) #(|u|
#1=(|DisjunctiveNormalForm| (|p1| |p2| |p3|)) NIL NIL NIL)
#(|--immediateData--| NIL ((|NonNegativeInteger|) . 0)
((|DisjunctiveNormalForm| (|p1| |p2| |p3|))) ((|target| . #1#)
21: (|upSEQ| (#(SEQ NIL NIL NIL NIL) (#(|Declare| NIL (#1=(|Void|) .
"()") (#1#) NIL) |u| D3) (#(LET NIL NIL NIL NIL) #(|u|
#2=(|DisjunctiveNormalForm| (|p1| |p2| |p3|)) NIL NIL NIL)
#(|--immediateData--| NIL 

[fricas-devel] The function BOOT::|#| is undefined.

2017-09-19 Thread Prof. Dr. Johannes Grabmeier privat
successfully compiled a domain, then the following happens. Any hint,
where to look for the error is welcome:


(178) -> D3 := DisjunctiveNormalForm [p1,p2,p3]

   (178)  DisjunctiveNormalForm([p1,p2,p3])

 
Type: Type
(179) -> )sh D3

   >> System error:
   The function BOOT::|#| is undefined.

(179) -> u : D3 := 0

   >> System error:
   The function BOOT::|#| is undefined.


-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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] help needed

2017-08-20 Thread Prof. Dr. Johannes Grabmeier privat
Hallo Ralph,

you abbreviated a package and implemented a category:


)abbrev category FOO Foo
Foo(Z: EuclideanDomain(), V: SetCategory()): Category == with
  laurentRelations: List Symbol -> List Polynomial Integer
  relationsIdealGenerators: List Integer -> List Polynomial Integer
  foo: () -> Integer
add
  foo(): Integer == 1

Another error occurs then with the local function, making it global, it
compiles.


Regards Johannes



Am 20.08.17 um 10:14 schrieb Ralf Hemmecke:
> On 08/20/2017 08:33 AM, oldk1331 wrote:
>> Did you upload the wrong attachment?
> Oh, indeed.
>
> Here the right one.
>
> Ralf
>

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
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] Different behaviour local Reference Variables from

2016-12-22 Thread Prof. Dr. Johannes Grabmeier privat
Hi Waldek,

you perfectly right to give the nitpick hint, that only functions can
access the local variables. Nevertheless, my complain is, that

- a "directly" imported package like the add-part of a category (I count
this as an function of the new domain/package in the first place)

   should have compiler priority to be chosen befor a

- further imported functions by the import key word.

Johannes




Am 20.12.16 um 23:31 schrieb Waldek Hebisch:
> Prof. Dr. Johannes Grabmeier wrote:
>> if I don't import another domain which also uses IML, then the compiler
>> correctly sees the variables from IML in its own defined new functiogs.
>> If, however, such an import is present, it uses the variables from the
>> IML from the import.
>>
>> My feeling is, that directly used IML from the domain/package should
>> have priority. Otherwise the uses can not know in setting the
>> appropriate variables
>> from the right domain, which package calling he should use. The
>> behaviour of the code is unforeseeable!
> Just a little nitpick: variables are strictly local and I believe
> that functions see correct variables.  But it is likely
> that compiler calls "wrong" function: instead of function
> from package it calls function from imported domain.
> Of course calling wrong function means that it will use
> wrong values of variables.

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-3224-192688

-- 
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] Different behaviour local Reference Variables from

2016-12-20 Thread Prof. Dr. Johannes Grabmeier privat
Hallo Waldek,

thanks for your quick explanation, I add my comments directly to your
comments


Am 20.12.16 um 22:35 schrieb Waldek Hebisch:
> Prof. Dr. Johannes Grabmeier wrote"
>> I observed the following behaviour. Perhaps someone can tell what is
>> going on, a bug of philosophy which I do not understad? If necessary I
>> can work out and provide a minimal example.
>>
>> 1. defined a category IML with several functions, all of them are
>> implemented in the category, some of them use local pointer variables of
>> the form
>> pF1: Reference Boolean :=3D ref false
>> in the add-part of the category
>>
>> 2. implemented domains (eg. DatabaseTable) which use this category via
>> Join(IML, ...) with ..
>> it works like designed: I can set from outside new values to the
>> Reference values, and then on the Boolean values depending functions of
>> the domain the set values
>> (from outside) are used and change the behaviour of the functions.
>> (mainly: information on intermediate values of variables)
>>
>> 3. implemented a package which use this category via IML with ...
>> Different behaviour: alll function codes from IML are available as
>> signatures of the package, there compiled code from IML- is available
>> and can be executed. The internal
>> variables - as in 2. - can be set from outside, the functions which
>> return the actual values show the changed values. HOWEVER, the code of
>> other functions in the package
>> do not realize, that the derefenced values are changed -- CONTRARY
>> to the identical settings in the domain case of 2. Then, the attempt to
>> repeat the definitions as
>>   pF1: Reference Boolean :=3D ref false
>> in the add-part of the package does NOT CHANGE this behaviour.
>> However, in this package a domain(DatabaseTable) which also has the categor=
>> y
>> IML implemented, is imported. Executed code now uses THE internal
>> values of pF1 of this domain for the execution of a function from the
>> package. Can it be, that the compiler
>> is confused and uses the wrong variable? This suspicion is confirmed
>> when I finally did a package call to % explicitly.
> Hmm, I do not know what you expect.  First, the add part of category
> is a special package.  For each domain/package of the category you
> get a separate copy of this package (normally you get a single copy
> for each tuple of parameters, but add part of category has the
> domain as a parameter).
>
> Second, variables in different domains/packages are completely
> separate.  In particular your domain/package does not directly
> see variables from IML -- the whole effect of variables in
> add part of IML is that they are visible to functions in
> add part of IML.
>
> Your problem may be that the compiler calls different
> function than the ones you expect: in case when multiple
> functions share signature the compiler will just choose
> one of them.

my discovered problem comes down to the following:

if I don't import another domain which also uses IML, then the compiler
correctly sees the variables from IML in its own defined new functiogs.
If, however, such an import is present, it uses the variables from the
IML from the import.

My feeling is, that directly used IML from the domain/package should
have priority. Otherwise the uses can not know in setting the
appropriate variables
from the right domain, which package calling he should use. The
behaviour of the code is unforeseeable!

Of course, as soon I discovered the problem, the work around for the
implemter is to use apprioriate package calling $% in the code.
>
> BTW: I do not understand why you use references.  Normally
> references are used when you want to modify values from
> places were variables are not visible.  That frequently
> means hairy logic and I would first search for errors
> in such logic.
>
I want to change the unseen local variables of a domain from outside,
i.e. at interpreter level. Do you claim that in this case I can do this
with normal local variables? at think I remember that this did not work.

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-3224-192688

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


[fricas-devel] Different behaviour local Reference Variables from category in domains/packages: Compiler uses wrong local variable

2016-12-20 Thread Prof. Dr. Johannes Grabmeier privat
Hallo all,
I observed the following behaviour. Perhaps someone can tell what is
going on, a bug of philosophy which I do not understad? If necessary I
can work out and provide a minimal example.

1. defined a category IML with several functions, all of them are
implemented in the category, some of them use local pointer variables of
the form
pF1: Reference Boolean := ref false
in the add-part of the category

2. implemented domains (eg. DatabaseTable) which use this category via
Join(IML, ...) with ..
it works like designed: I can set from outside new values to the
Reference values, and then on the Boolean values depending functions of
the domain the set values
(from outside) are used and change the behaviour of the functions.
(mainly: information on intermediate values of variables)

3. implemented a package which use this category via IML with ...
Different behaviour: alll function codes from IML are available as
signatures of the package, there compiled code from IML- is available
and can be executed. The internal
variables - as in 2. - can be set from outside, the functions which
return the actual values show the changed values. HOWEVER, the code of
other functions in the package
do not realize, that the derefenced values are changed -- CONTRARY
to the identical settings in the domain case of 2. Then, the attempt to
repeat the definitions as
  pF1: Reference Boolean := ref false
in the add-part of the package does NOT CHANGE this behaviour.
However, in this package a domain(DatabaseTable) which also has the category
IML implemented, is imported. Executed code now uses THE internal
values of pF1 of this domain for the execution of a function from the
package. Can it be, that the compiler
is confused and uses the wrong variable? This suspicion is confirmed
when I finally did a package call to % explicitly.




Here a protocol of the working example in a domain DBT:

(72) -> setMessageLevel(0)$DBT

   (72)  0
 Type:
NonNegativeInteger
   Time: 0.00 (OT) =
0.00 sec
(73) -> variableColumn(STCL, "Augenfarbe")

   (73)
   ["braun", "braun", "braun", "braun", "braun", "blau", "braun", "braun",
"gruen", "gruen", "gruen", "blau", "blau", "blau"]
   Type:
Vector(Union(Float,Integer,String,null))
   Time: 0.00 (OT) =
0.00 sec
(74) -> setMessageLevel(3)$DBT

   (74)  3
 Type:
NonNegativeInteger
  Time:
0 sec
(75) -> variableColumn(STCL, "Augenfarbe")
   variableColumn: var  =  "Augenfarbe"
   variable?  true

   (75)
   ["braun", "braun", "braun", "braun", "braun", "blau", "braun", "braun",
"gruen", "gruen", "gruen", "blau", "blau", "blau"]
   Type:
Vector(Union(Float,Integer,String,null))
  Time:
0 sec


Note the different info in red according to the changed internal
Reference value.


Now the package, the crucial part of the implementation in the package
CLAP is

print blankSeparate ["messageLevelPointer = ", (mLP 3)::OF] -- always is
printed, however, calls pF3 from domain DBT
if mLP(3)$% then print equalLine() -- uses the local variable pF3
if mLP 3 then print blankSeparate ["x = ", x::OF] -- uses the external
local variable pF3 from imported domain DBT

My expectation would be that not package called code should use the
local variables of the package and not those of other imported domains!


(108) -> messageLevelPointer(3)$CLAP

   (108)  false
Type:
Boolean
   Time: 0.00 (IN) + 0.01 (OT) =
0.01 sec
(109) -> messageLevelPointer(3)$DBT

   (109)  false
Type:
Boolean
   Time: 0.00 (OT) =
0.00 sec
(110) -> initialCondorcetClustering([i for i in 1..14], aev)$CLAP
   messageLevelPointer =  false
   messageLevelPointer =  false
 

   (110)  [[1,4,6,7],[2],[3,5,8,14],[9,10],[11],[12,13]]
Type:
List(List(Integer))
   Time: 0.15 (EV) + 0.04 (OT) =
0.20 sec
(111) -> setMessageLevel(3)$CLAP

   (111)  3
 Type:
NonNegativeInteger
  Time:
0 sec
(112) -> messageLevelPointer(3)$CLAP

   (112)  true
Type:
Boolean
  Time:
0 sec
(113) -> initialCondorcetClustering([i for i in 1..14], aev)$CLAP

   messageLevelPointer =  false
   

[fricas-devel] illegal terminating character after a colon: #\Newline

2016-09-16 Thread Prof. Dr. Johannes Grabmeier privat
Any hints required: a very strange behaviour in a code, unfortunately
minimal example tedious to construct. Perhaps somebody has any ideas, if
not, I will try to construct a minimal example.

The following behaviour, a package with type parameter VEL has several
functions. All compile (trivial code), while X and YY can be used, the
call of PhiKG causes the shown error, FriCAS goes in debugging mode, I
have not the slightest idea what is going on.


 FMRKG ==> FreeModuleRectangleKG(K, G, VEL, V, Y)
  VR==> VelocityRectangle(K, G, VEL, V)
  Exports ==>  with
X : VEL -> VEL
Z : (VEL, FMRKG) -> FMRKG
ZZ : VEL -> FMRKG
YY : FMRKG -> FMRKG
PhiKG: VEL -> FMRKG


after the following statement it breaks.
i

(265) -> PhiKG(V.1)$VFG

debugger invoked on a SIMPLE-CONDITION: break

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [CONTINUE] Return from BREAK.

(|evalSlotDomain| 11 #1=#((|VelocityFunctionKG| #2=(|Fraction|
#3=(|Integer|)) #4=(|CyclicGroup4d|) #5=(|CyclicTwoDimensionalVelocity|
#2#) #6=(#7=((0 .

.


|velocities| 40 ...)) NIL 63 (#(|TwoDimensionalVelocityCategory&|
|VelocityCategory&| |Module&| T T T T |AbelianGroup&| T |AbelianMonoid&|
|AbelianSemiGroup&| |MonoidAction&| ...) #(# # # # # # # # # # # # ...)
. #(0 6 0 10 0 7 0 11 2 8 6 0 ...)) #46=#((|List| #2#) (#42# #46# #) NIL
261759 (# # . #) #(# # NIL 130879 # NIL #31# 1 # # # # ...) #31#
(# . #46#) (|Boolean|) (# . #46#) (# . #46#)
(# . #46#) ...) #31# #41# #46# (# . #45#) (#40# #45# 0 . |One|) (#40# #45# 4 .
|One|) ...) #31# (|List| $) #41# (# .
#43#) 1 (|Boolean|) ...) #6# #25# #28# ...))
0] :

   >> System error:
   illegal terminating character after a colon: #\Newline

  Stream: #

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-3224-192688

-- 
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] exit by Ctrl-D ?

2016-06-22 Thread Prof. Dr. Johannes Grabmeier privat
similar problem, how to interrupt a running computation in FriCAS 1.2.6 ?

(vs. FriCAS-1.2.6-x86_64-macos10.6.tar.xz)



Am 22.06.16 um 15:36 schrieb oldk1331:
> Can we exit FriCAS by press Ctrl-D in terminal?
>
> If not, where can we add it, sman or clef or
> somthing else?
>
> -- 
> 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.
>
> -- 
> Mit freundlichen Grüßen
>
> Johannes Grabmeier
>
> Prof. Dr. Johannes Grabmeier
> Köckstraße 1, D-94469 Deggendorf
> Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
> Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-3224-192688

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


[fricas-devel] Strange behaviour of Interpreter variables in function bodies

2016-06-15 Thread Prof. Dr. Johannes Grabmeier privat
Hi all,

by preparing for a lecture on Newton iteration I did the following,
which strange behaviour. Note, that p  and p' in the body of a function
are not evaluated, while x is evaluated. Can one explain the philosophy
behind - or it is a bug (I hope) - and how to do it to achieve the
expected behaviour?


(1) -> p := x^3+4*x^2-10

 3 2
   (1)  x  + 4x  - 10
Type:
Polynomial(Integer)
(2) -> p' := D p

  2
   (2)  3x  + 8x
Type:
UnivariatePolynomial(x,Integer)
(3) -> N(x) == x - p/p'
   Type:
Void
(4) -> N(x)
   Compiling function N with type Variable(x) -> Fraction(Polynomial(
  Integer))

  3 2
2x  + 4x  + 10
   (4)  --
 2
   3x  + 8x
  Type:
Fraction(Polynomial(Integer))
(5) -> N(1)
   Compiling function N with type PositiveInteger -> Fraction(
  Polynomial(Integer))

   32
- x  - x  + 8x + 10
   (5)  ---
2
  3x  + 8x
  Type:
Fraction(Polynomial(Integer))
(6) -> 1-p/p'

   32
- x  - x  + 8x + 10
   (6)  ---
2
  3x  + 8x
  Type:
Fraction(Polynomial(Integer))

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-3224-192688

-- 
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] Additive Abelian Groups

2016-03-30 Thread Prof. Dr. Johannes Grabmeier privat
Dear Martin,

long ago I also wrote code in AXIOM for computing homological
resolutions for finite p-groups. Perhaps this might help, or can be
embedded. Please indicate, if you are interested in this code.

(see J. Grabmeier, L.A. Lambe, Computing resolutions over finite
p-groups ,in: A. Betten, A. Kohnert, R. Laue, A. Wassermann (Eds.),
Proceedings ALCOMA’99, Springer Lecture Notes in Computational Science
and Engineering, Springer-Verlag, Heidelberg (2000))


Am 30.03.16 um 11:07 schrieb Martin Baker:
> Kurt and Ralf,
>
> Thank you very much for your replies.
>
> I will have a look at Kenzo and the Computational Homology book, they
> look very interesting.
>
> The task of implementing all the algebraic topology that I would like
> is quite daunting and therefore it would be good if it could be done
> in stages. If Waldek thinks it would be suitable to include with
> FriCAS then it would help to add at an early stage (perhaps labeled as
> experimental). Apart from anything else I am starting to loose track
> of the dependencies, for example, to get the code to work I had to fix
> a bug in spanning tree in graph code. Also if the code is in a FriCAS
> release I might get more help from you and the others on this list
> (and I need all the help I can get).
>
> On 30/03/16 03:07, Kurt Pagani wrote:
> > I'd be content if only cubical homology (à la
> > http://www.springer.com/la/book/9780387408538) would be available, what
> > seems to be computationally (more) feasible in Fricas.
>
> I was thinking of including cubical complexes. I get the impression
> they would be better for implementing products (Cartesian and tensor)?
> I have started to implement products in simplicial complexes but
> that's not complete yet.
>
> Talking of products, I would also like an 'adjacency tensor', that is
> an extension of 'adjacency matrix' from graph to simplicial complex.
> Then if Kronecker sum and product could be implemented in tensors
> there would be an alternative way to do products and sums in
> simplicial complexes. At least this would be a useful check on the
> code even if it does not scale up well.
>
> > Regarding CoChainComplex'es, I think this will become of interest only
> > in connection with some topological assumptions, e.g. DeRham currents
> > vs. differential forms. DeRhamComplex in Fricas should be completed by
> > its "dual", DeRhamCurrent(s), then we had at least "integration over
> > simple manifolds" (glueing of elementary surfaces/chains, e.g. pushing
> > forward simplices or cubes).
> >
> > Of course abstract and/or algebraic homology/cohomology is also useful,
> > however, the laboured problems usually come from topological duality
> > (I'm quite aware that we cannot implement 'continuity', 'compact
> > support' and so on, but at least one could circumvent a lot of tedious
> > calculations).
>
> I like it when the Axiom/FriCAS library code all joins up rather than
> being a set of apparently unconnected domains. Could algebraic
> topology be a way to connect this all up.
>
> >> On 30/03/16 07:13, Ralf Hemmecke wrote:
> > Hi Martin
> >
> > Just a small hint... I didn't yet have much time to go over your code.
> >
> >
> https://github.com/martinbaker/multivector/blob/master/algebraictopology.spad#L134
> >
> > Why do you write something like this?
> >
> > join:(a:%,b:%) -> %
> >
> > where
> >
> > join: (%, %) -> %
> >
> > would be a more natural type for that function?
>
> When I am trying to understand other peoples code (or my code if its
> its more than a few days old) I find it really helps if I can avoid
> scrolling up and down the page all the time. I find it much easier to
> work in a screen where I can see all the relevant information together
> and self contained in a small space. I therefore tend to duplicate
> this information in the function definition and the export. I also
> duplicate the comments (which I suspect you also don't like). If
> everyone here thinks I should remove this duplication then I will do
> so but I think that would make code harder to understand.
>
> > Similar to your implementation of graphs, I don't see a mathematical
> > reason to store the coordinates of the vertices. If I had to implement
> > all this, I would think of an abstract domain Vertex or maybe Label
> > that stores all the necessary information that you would like to
> > see/need for
> > a vertex. Then you can have one domain Vertex == Integer and another
> > Vertex == Record(Integer, CoordinatesOfVertex). The main code for
> > simplices/graphs would work the same since that only depends on the
> > exported functions but not on the concrete representation. Only
> > functions or packages that deal with the output of graphs/simplices
> > would have to require knowledge about coordinates.
>
> I really do want to have both a geometric and combinitorial model of
> these structures, at least at the top level. In fact I would like to
> put it into the scenegraph graphics so that the graphics code has more

[fricas-devel] FriCAS compiler: local variable overrides domain variable

2016-02-22 Thread Prof. Dr. Johannes Grabmeier privat
I has a domain with a parameter V of type List Something.
In this domain I carelessly defined a local parameter in the body of a
function: V: Matrix SomethingElse.

no complaints

The FIRST application of this function worked, while the second failed
with some index out of range error, I guess when the domain parameter V
was called the next time.

I think this should be forbidden at compile time.

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-3224-192688

-- 
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: Introduction to FriCAS/Axiom

2016-01-11 Thread Prof. Dr. Johannes Grabmeier privat
To prove the importance of symbolic computations, certainly, symbolic
integration is a bad, if not the worst example -- as for all practical
problems numerical method will do as your professor claims.

But the beauty of symbolic methods certainly can be demonstrated by the
Risch algorithm.

To my opinion: one should not play off one against the other aspect! So
for a computer algebra system like FriCAS the completion of symbolic
integration is a valid target, perhaps right now there are still more
important target as improvement of usability for unexperienced users.



Am 11.01.16 um 10:23 schrieb oldk1331:
> Thanks for your informative replies, Waldek Hebisch.
> I have a question related about Risch algorithm and its
> implementation in FriCAS.
>
> I asked my math professor about Risch algorithm before,
> he never heard of it and he seemed to not care about it,
> because "numerical methods are enough, nobody cares
> about symbolic results".  I want to know your perspective
> of the future of Risch algorithm and its implementation in
> FriCAS.
> -- 
> 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.
>
> -- 
> Mit freundlichen Grüßen
>
> Johannes Grabmeier
>
> Prof. Dr. Johannes Grabmeier
> Köckstraße 1, D-94469 Deggendorf
> Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
> Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-3224-192688

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


[fricas-devel] Compiler problem, strange difference in 2 cases

2015-11-01 Thread Prof. Dr. Johannes Grabmeier privat
I desperately look for the reason of a strange behaviour of compiled
SPAD code:

I have coded a category MonoidAction with default code containing the
code for "orbit" using the group action *

Then I made two different domains for this category, for one the
inherited "orbit" functions works without problem,

(18) -> g := enG.1

   (18)  (1 5 4 3 2)
 Type:
Permutation(OneToN(5))
(19) -> g * w-- group action works!)

   (19)  3
 Type:
PermutationGroupOnN(5)
(20) -> orbit w  -- inherited operation from category default works)

   (20)  [3,4,5,2,1]
   Type:
List(PermutationGroupOnN(5))


for the other, however, I get a strange break occuring immediately when
I call orbit:


D*v  --group action works!)


   (7)  [- 1,0]
  Type:
CyclicTwoDimensionalVelocity(Fraction(Integer),d)
(8) -> orbit v  -- inherited operation orbit from category defaults
immediately fails:

debugger invoked on a SIMPLE-CONDITION: break

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [CONTINUE] Return from BREAK.

(|evalSlotDomain| 4 #1=#((|CyclicTwoDimensionalVelocity| #2=(|Fraction|
#3=(|Integer|)) |d|) (#4=# #1# #(~= 35
|stabilizer| 41 |second| 46 |orbitLengths| 51 |orbitLength| 56 |orbit|
61 ...)) NIL 0 (#(|MonoidAction&| |SetCategory&| |BasicType&| T)
#((|MonoidAction| (|CyclicGroup| 4 7)) (|SetCategory|) (|BasicType|)
(|CoercibleTo| 32)) . #(0 10 9 11 0 6 0 14 0 10 0 15 ...)) #5=#((|List|
#2#) (# #5# #(|setUnion| 102
|setIntersection| 108 |setDifference| 114 |removeDuplicates| 120 |null|
125 |nil| 130 ...)) NIL 261759 (#(|ListAggregate&| #(# # NIL 0 # NIL #5#
#6=# # # # # ...) |ExtensibleLinearAggregate&| |FiniteLinearAggregate&|
|UnaryRecursiveAggregate&| |LinearAggregate&| |RecursiveAggregate&|
|IndexedAggregate&| |Collection&| |OrderedSet&| |HomogeneousAggregate&|
T ...) #((|ListAggregate| 6) (|StreamAggregate| 6)
(|ExtensibleLinearAggregate| 6) (|FiniteLinearAggregate| 6)
(|UnaryRecursiveAggregate| 6) (|LinearAggregate| 6)
(|RecursiveAggregate| 6) (|IndexedAggregate| 27 6) (|Collection| 6)
(|OrderedSet|) (|HomogeneousAggregate| 6) (|Comparable|) ...) . #(1 13
12 0 14 3 13 12 0 15 15 16 ...)) #7=#((|IndexedList| #2# 1) (#4# #7#
#(~= 97 |value| 103 |third| 108 |tail| 113 |swap!| 118 |split!| 125
...)) NIL 130879 (#(|ListAggregate&| |StreamAggregate&|
|ExtensibleLinearAggregate&| |FiniteLinearAggregate&| #
|LinearAggregate&| |RecursiveAggregate&| |IndexedAggregate&|
|Collection&| |OrderedSet&| |HomogeneousAggregate&| T ...) #(# # # # # #
# # # # # # ...) . #(1 0 11 0 35 1 0 0 0 37 1 6 ...)) NIL #6# 1
(|NonNegativeInteger|) (# . #7#) (# . #7#) (|Boolean|) ...) #6# (# . #5#) (|Boolean|) (# . #5#)
(# . #5#) (# .
#5#) ...) #6# |d| #5# (|List| $) #8=#((|CyclicGroup| 4 |d|) (#4# #8#
#(~= 41 |smaller?| 47 |size| 53 |sample| 57 |recip| 61 |random| 66 ...))
NIL 0 (#(|FiniteGroup&| |Group&| |Monoid&| |SemiGroup&| T |Finite&|
|SetCategory&| T T T |BasicType&| T ...) #((|FiniteGroup|) (|Group|)
(|Monoid|) (|SemiGroup|) (|Comparable|) (|Finite|) (|SetCategory|)
(|ConvertibleTo| 20) (|FinitelyGenerated|) (|ConvertibleTo| 43)
(|BasicType|) (|unitsKnown|) ...) . #(1 12 11 0 13 1 14 11 0 15 2 11
...)) NIL 4 |d| #9=#(#3# (#4# #9# #(~= 121 |zero?| 127 |unitNormal| 132
|unitCanonical| 137 |unit?| 142 |symmetricRemainder| 147 ...)) NIL 0
(#(|IntegerNumberSystem&| |PolynomialFactorizationExplicit&|
|EuclideanDomain&| |UniqueFactorizationDomain&| T T |GcdDomain&| T
|OrderedRing&| T |Algebra&| T ...) #(# # # # # # # # # # # # ...) . #(1
7 6 0 8 3 7 6 0 9 9 10 ...)) NIL (|Void|) (|OpenMathDevice|)
(#10=# #9# 0 . |OMputApp|) (|String|) (#10# #9# 5 .
|OMputSymbol|) #3# ...) (|Boolean|) (# .
#8#) (|OutputForm|) ...) (# . #8#) ...))
0]

Any Idea what is going on here?


Here are the 2 different code pieces:

Working code using MonoidAction:

)abbrev domain PGM PermutationGroupOnN
PermutationGroupOnN(n: PositiveInteger): Exports == Implementation where
  G  ==> Permutation OneToN(n)
  Exports==> Join(MonoidAction(G), SetCategory, Finite, StepThrough,
OrderedFinite, RetractableFrom Integer, RetractableTo Integer,
  RetractableTo PositiveInteger)
  Implementation ==> OneToN(n) add
Rep := OneToN(n)
((g: G) * (v: %)): % == eval(g,v::Rep)$G

Code with some error I do not know:


)abbrev domain CYC2DV CyclicTwoDimensionalVelocity
CyclicTwoDimensionalVelocity(R: Field, d: Symbol): Exports ==
Implementation where
  G   ==> CyclicGroup(4, d)
  Exports ==> MonoidAction(G) with
construct: (R, R) -> %
  ++ [vx,vy] constructs a 2 dim velocity element.
first : % -> R
second : % -> R
  Implementation ==> List R add
Rep := List R
D : G := first generators()$G
construct(vx: R, vy: R): % == [vx,vy]
first(v: %): R == v.1
second(v: %): R == v.2
((g: G) * (v: 

[fricas-devel] Bug in delete! of List

2015-11-01 Thread Prof. Dr. Johannes Grabmeier privat
I found the following bug in the basis List domain:

(121) -> li := [5,6,7,8,9]

   (121)  [5,6,7,8,9]
  Type:
List(PositiveInteger)
(122) -> delete!(li,1)

   (122)  [6,7,8,9]
  Type:
List(PositiveInteger)
(123) -> li

   (123)  [5,6,7,8,9]
  Type:
List(PositiveInteger)
(124) -> delete!(li,1)

   (124)  [6,7,8,9]
  Type:
List(PositiveInteger)
(125) -> delete!(li,1)

   (125)  [6,7,8,9]
  Type:
List(PositiveInteger)
(126) -> delete!(li,1)

   (126)  [6,7,8,9]
  Type:
List(PositiveInteger)
(127) -> delete!(li,2)

   (127)  [5,7,8,9]
  Type:
List(PositiveInteger)
(128) -> delete!(li,2)

   (128)  [5,8,9]
  Type:
List(PositiveInteger)
(129) -> delete!(li,2)

   (129)  [5,9]
  Type:
List(PositiveInteger)
(130) -> delete!(li,2)

   (130)  [5]


The reason is in the following code:

   delete!(x : %, i : Integer) ==
   i < (m := minIndex x) => error "index out of range"
   i = m =>  rest x
   y := rest(x, (i - 1 - m)::NonNegativeInteger)
   setrest!(y, rest(y, 2))
   x

for category ListAggregate

where the case i = m (=1) does return rest x as desired, but not destructively, 
while this is done for the other cases via setrest!

As destructive list changes are done via LISP operations I have to leave it to 
the experts for that to fix this bug.

-- 


Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-3224-192688

-- 
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 http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] numeric evaluation problem with error function

2015-10-22 Thread Prof. Dr. Johannes Grabmeier privat
another problem with numeric evaluations for computing the normal
distribution using the error function.
To my opinion, numeric NV(0.7) directly should return 0.7580363478



  Type:
Float
(52) -> NV(x) == (1+erf(x/sqrt(2)))/2
   Compiled code for NV has been cleared.
   1 old definition(s) deleted for function or rule NV
   Type:
Void
(53) -> numeric NV(0.7)
   Compiling function NV with type Float -> Expression(Float)

   >> Error detected within library code:
   Can only compute the numerical value of a constant, real-valued
Expression

(53) -> NV(0.7)

   (53)  0.5 erf(0.4949747468) + 0.5
  Type:
Expression(Float)
(54) -> numeric NV(0.7)

   >> Error detected within library code:
   Can only compute the numerical value of a constant, real-valued
Expression

(54) -> erf(0.4949747468)

   (54)  0.5160726955_315973

(55) -> 0.5*erf(0.4949747468)+0.5

   (55)  0.7580363478
  Type:
Float
> -- 
> Mit freundlichen Grüßen
>
> Johannes Grabmeier
>
> Prof. Dr. Johannes Grabmeier
> Köckstraße 1, D-94469 Deggendorf
> Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
> Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-3224-192688

-- 
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 http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


[fricas-devel] Problems with binary Mac OSX version

2015-09-11 Thread Prof. Dr. Johannes Grabmeier privat
Hi all,

I use the binary version

   FriCAS Computer Algebra System
Version: FriCAS 1.2.6
  Timestamp: Thu Jun 25 10:48:08 CEST 2015
-

The following question, problems:

1. in my older self compiled version with a different LISP I used ctrl -
x etc. to interrupt an infinite loop computation, this is not working
here, what is the secret to interrupt?

2. retrieval mechanism (clef?) is horrible: letters disappear while over
typing an old expression, others are added. Can't work with that. Solution?

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-3224-192688

-- 
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 http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] New release

2015-09-11 Thread Prof. Dr. Johannes Grabmeier privat
Hallo Waldek,

here a two little improvements/enhancements:

I made CyclicGroup of category CommutativeStar and accordingly for
MonoidRing, if the Monoid has CommutativeStar, so we can e.g. compute
the determinant of a matrix over a group ring of the cyclic group. I
also added a function monomialElements as partner of coefficients, which
was missing in MonoidRing.

Please include in new release.


(1) -> )r testMRING.input
C := CyclicGroup(4, d)


   (1)  CyclicGroup(4,d)
   Type:
Type
C has CommutativeStar


   (2)  true
Type:
Boolean
RC := MonoidRing(Integer, C)


   (3)  MonoidRing(Integer,CyclicGroup(4,d))
   Type:
Type
RC has CommutativeStar


   (4)  true
Type:
Boolean
a : RC := reduce(+, [monomial(c,m)$RC for c in [-3,0,1,-1] for m in
enumerate()$C])


   32
   (5)  - d  + d  - 3
   Type:
MonoidRing(Integer,CyclicGroup(4,d))
monomialElements(a)


  3  2
   (6)  [d ,d ,1]
 Type:
List(CyclicGroup(4,d))
coefficients(a)


   (7)  [- 1,1,- 3]
  Type:
List(Integer)
m : Matrix RC := matrix [[1,a],[a^2,a-1]]


+32+
| 1   - d  + d  - 3|
   (8)  |  |
|  3 2   32|
+6d  - 5d  - 2d + 10  - d  + d  - 4+
   Type:
Matrix(MonoidRing(Integer,CyclicGroup(4,d)))
determinant m


   3  2
   (9)  29d  - 18d  - 17d + 29
   Type:
MonoidRing(Integer,CyclicGroup(4,d))
(10) ->


Am 09.09.15 um 03:25 schrieb Waldek Hebisch:
> I would like to do a new release in September.  There is still
> some time to include new code.  In about 10 days I would like
> to start release process (that is up to release allow only
> critical bugfixes).
>
>
> -- 
> Mit freundlichen Grüßen
>
> Johannes Grabmeier
>
> Prof. Dr. Johannes Grabmeier
> Köckstraße 1, D-94469 Deggendorf
> Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
> Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-3224-192688

-- 
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 http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
)abbrev category FINGRP FiniteGroup
++ Author: Franz Lehner
++ Date Created: 30.04.2008
++ Basic Functions:
++ Related Constructors:
++ Also See:
++ AMS Classifications:
++ Keywords:
++ References:
++ Description:
++ The category of finite groups.
FiniteGroup : Category == Join(Group, Finite) with
order : % -> Integer
++ \spad{order(x)} computes the order of the element $x$.
  add -- default
order x ==
k:Integer := 1
y:% := x
while not one? y repeat
k := k+1
y := y*x
k

)abbrev package FINGPKG FiniteGroupPackage
++ Author: Franz Lehner
++ Date Created: 02.01.2015
++ Date Last Updated:
++ Basic Functions:
++ Related Constructors:
++ Also See:
++ AMS Classifications:
++ Keywords:
++ References:
++ Description:
++ A package for permutation representations of finite groups.
FiniteGroupPackage(G:Join(Group, Finite)) : with
permutationRepresentation : G -> Permutation Integer
++ \spad{permutationRepresentation(x)} returns the permutation induced by x 
on \spad{enumerate()$G}
regularRepresentation : G -> Matrix Integer
++ \spad{regularRepresentation(x)} returns the matrix representation of the
++ permutation \spad{permutationRep(x)}
  == add
permutationRepresentation(x:G) : Permutation Integer ==
all : List G := enumerate()$G
n : Integer := (#all)::Integer
xall := [x*a for a in all]
k : Integer
preimag : List Integer := [k for k in 1..n]
imag : List Integer := [position(a, xall) for a in all]
p : Permutation Integer := coercePreimagesImages([preimag, imag])

regularRepresentation(x:G) : Matrix Integer ==
n : Integer := size()$G
permutationRepresentation(permutationRepresentation x, 
n)$(RepresentationPackage1 Integer)

)abbrev category FINGEN FinitelyGenerated
++ Author: Franz Lehner
++ Date Created: 30.04.2008
++ Date Last Updated:
++ Basic Functions:
++ Related Constructors:
++ Also See:
++ AMS Classifications:
++ Keywords:
++ References:
++ Description:
++ A category for finitely generated structures.
++ Exports a list of 

Re: [fricas-devel] Problems with binary Mac OSX version

2015-09-11 Thread Prof. Dr. Johannes Grabmeier privat
see my answers:

Am 11.09.15 um 15:38 schrieb Waldek Hebisch:
> Prof. Dr. Johannes Grabmeier wrote:
>> Hi all,
>>
>> I use the binary version
>>
>>FriCAS Computer Algebra System
>> Version: FriCAS 1.2.6
>>   Timestamp: Thu Jun 25 10:48:08 CEST 2015
>> -
>>
>> The following question, problems:
>>
>> 1. in my older self compiled version with a different LISP I used ctrl -
>> x etc. to interrupt an infinite loop computation, this is not working
>> here, what is the secret to interrupt?
> What you mean by "not working"?  Does it mean that when you start
> a long computation and press ctrl-c the computaion is going
> on?  On my amd64 when using sbcl when I do:
>
> ss(n) == (s := 0; for i in 1..n repeat s := s + 1; s)
> ss(10^9)
>
> and press ctrl-c I get:
>
>>> System error:
>Interactive interrupt at #x1005B983D7.
yes: ctrl-c does not stop this computation for me. However, it is fast,
in this case, a few seconds later the result appers.
The only way for me to stop a really infinite loop is to kill the
window/process.
>
> as designed.   But this depends on Lisp and operating system.
>
>> 2. retrieval mechanism (clef?) is horrible: letters disappear while over
>> typing an old expression, others are added. Can't work with that. Solution?
> I plan to look into clef problems, but currently I am busy
> with other things.  Some people use 'rlwrap' (look in the
> old posts for exact intruction how to use it). 
>
thanks, I will do

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-3224-192688

-- 
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 http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] New release

2015-09-11 Thread Prof. Dr. Johannes Grabmeier privat
no and yes:

a finite group is not necessarily commutative, I only changed the
CyclicGroup there!

MRING: Yes, we need CommutativeRing !


Am 11.09.15 um 15:07 schrieb Waldek Hebisch:
> Prof. Dr. Johanneas Grabmeier wrote:
>> here a two little improvements/enhancements:
>>
>> I made CyclicGroup of category CommutativeStar and accordingly for
>> MonoidRing, if the Monoid has CommutativeStar, so we can e.g. compute
>> the determinant of a matrix over a group ring of the cyclic group. I
>> also added a function monomialElements as partner of coefficients, which
>> was missing in MonoidRing.
> As Franz wrote we already have 'support'.  Concerning categories,
> do you mean the following:
>
> Index: src/algebra/discrgrp.spad
> ===
> --- src/algebra/discrgrp.spad   (revision 1941)
> +++ src/algebra/discrgrp.spad   (working copy)
> @@ -10,7 +10,7 @@
>  ++ References:
>  ++ Description:
>  ++ The category of finite groups.
> -FiniteGroup : Category == Join(Group, Finite) with
> +FiniteGroup : Category == Join(Group, CommutativeStar, Finite) with
>  order : % -> Integer
>  ++ \spad{order(x)} computes the order of the element $x$.
>add -- default
> Index: src/algebra/mring.spad
> ===
> --- src/algebra/mring.spad  (revision 1941)
> +++ src/algebra/mring.spad  (working copy)
> @@ -44,6 +44,8 @@
>  if R has CharacteristicZero then CharacteristicZero
>  if R has CharacteristicNonZero then CharacteristicNonZero
>  if R has CommutativeRing then Algebra(R)
> +if R has CommutativeRing and M has CommutativeStar then
> +  CommutativeRing
>  if (R has Finite and M has Finite) then Finite
>  if M has Comparable then
>FreeModuleCategory(R, M) 
>
>
> -- 
> Mit freundlichen Grüßen
>
> Johannes Grabmeier
>
> Prof. Dr. Johannes Grabmeier
> Köckstraße 1, D-94469 Deggendorf
> Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
> Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-3224-192688

-- 
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 http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] Generalizing categories

2015-08-18 Thread Prof. Dr. Johannes Grabmeier privat
before things became to complicated and long names to obey utmost
generality, I suggest to think about, whether there are non abelian
applications which use the +-symbol. I am curious to here about them.

As long as there is not a real bunch of them and as long there is no
concrete plan to extend AXIOM/FriCAS to have group categories with a
free chosen operational symbol, I would recommend to keep the usual
mathematical convention to have + an abelian operation and to having *
to be non commutative or commutative.

Johannes


Am 18.08.15 um 19:49 schrieb Ralf Hemmecke:
 OK, in analogy with exising names we get AdditiveMagmaWithUnit
 That's also OK for me.

 I'm not really sure, but maybe we could think of introducing a category
 that represents the axioms. AdditiveSemigroup is OK for associativity,
 but, according to https://en.wikipedia.org/wiki/Magma_%28algebra%29
 there is also unital magma, i.e. without associativity.
 AFAICS it is exactly AdditiveMagmaWithUnit (2 above).
 I don't care so much whether it is UnitalAdditiveMagma or
 AdditiveMagmaWithUnit. In fact, I cannot say which one I like better.
 At least unital magma should appear somewhere in the documentation, if
 it becomes the ...WithUnit thing.

 Although Abelian seems to be used consistently, i.e. always only wrt.
 the + operation, why not continue using Additive and Multiplicative
 in the name to avoid confusion? I.e. we would have AbelianAdditiveGroup,
 AbelianMultiplicativeGroup, etc.

 Currently, we have Group reserved for *. The respective categories for +
 always include commutativity. Not perfect, I would say. So I would want
 AdditiveGroup and MultiplicativeGroup.
 Names can get quite long, like CancellationAbelianMonoid.  I think
 when we have opportunity to shorten names without confusion we
 should use it.
 Well, yes, that's a good reason. But for me and probably also for others
 it's strange that AbelianMonoid does not inherit from Monoid.
 If it where AbelianAdditiveMonoid and AbelianMultiplicativeMonoid the
 inheritance (from AdditiveMonoid or MultiplicativeMonoid) would be
 clear. That's what I meant in my last mail by duplicating some category
 hierarchy.

 If names are to long for you then what about Monoid_* and Monoid_+?
 Although I don't like too many underscores in names, we could then also
 have Semigroup_\_/ and Semigroup_/_\ (instead of JoinSemigroup and
 MeetSemigroup).

 For the general category hierarchy, I'm rather in favour of long names
 that easily (intuitively?) allow to guess inheritance. I therefore opt
 to include Additive and Multiplicative for the two hierarchies wrt +
 and * and reserve the generic names (SemiGroup, Monoid, Group) for the
 time when we can rename operations or parametrize op-names in the category.

 Ralf




-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-3224-192688

-- 
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 http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] Generalizing categories

2015-08-17 Thread Prof. Dr. Johannes Grabmeier privat
Another hint: AXIOM/FriCAS already has some of these new categories;

in the non-associativity world we once provided

Monad  ( 1) for *)
MonadWithUnit ( 2) for *)

However, it was never unified with the associative world, which really
should be done to be consistent.


Am 17.08.15 um 02:14 schrieb Waldek Hebisch:
 Axiom core algebraic categories are taken from classis mostly
 commutative algebra.  I am thinking about extending them
 to allow weaker assumpion.  We have two basic operations,
 '+' and '*'.  Most domains assume that '+' is an operation
 from an abelian group, and that '*' is from a monoid and
 plays nicely with '+'.  I consider the following categories:

 1) Just operation '+' (named AdditiveOperation or possible
AdditiveMagma)
 2) '+' and 0 (neutral element) I am tempted to call it
AdditiveOperation0
 3) Associativity: AdditiveSemigroup
 4) Associativity and 0: AdditiveMonoid
 5) Associativity and Inverse: AdditiveGroup
 6) Associativity and cancellation property (left/right)

 3, 4, 5 and commutativity give existing categories: AbelianSemigroup,
 AbelianMonoid, AbelianGroup

 Then similar categories for '*', starting from say
 MultiplicativeOperation).

 Then we get categories combining the two operations:
 - just operation
 - 0 which is identity for '+' and satisfies 0*x = x*0 = 0
   (supposedly this is called Shell)
 - near-semiring: two associative operations with right
   distributive law
 - near-ring: group with respect to addition

 I do not expect to be able to perform a lot of computations with
 domains of such general categories.  However, some exaples are
 easy to create and I think it would be nice to have them
 incorporated into our category hierarchy.
 -- 
 Mit freundlichen Grüßen

 Johannes Grabmeier

 Prof. Dr. Johannes Grabmeier
 Köckstraße 1, D-94469 Deggendorf
 Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
 Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-3224-192688

-- 
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 http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [fricas-devel] Generalizing categories

2015-08-17 Thread Prof. Dr. Johannes Grabmeier privat
I would not mind, at that time it was a 51 to 49 decision against Magma

Am 17.08.15 um 10:04 schrieb Martin Baker:
 On 17/08/15 08:57, Prof. Dr. Johannes Grabmeier privat wrote:
 Another hint: AXIOM/FriCAS already has some of these new categories;

 in the non-associativity world we once provided

 Monad  ( 1) for *)
 MonadWithUnit ( 2) for *)

 However, it was never unified with the associative world, which really
 should be done to be consistent.

 Is this a chance to rename 'Monad' which seems to conflict with modern
 usage?

 Martin


 -- 
 Mit freundlichen Grüßen

 Johannes Grabmeier

 Prof. Dr. Johannes Grabmeier
 Köckstraße 1, D-94469 Deggendorf
 Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
 Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-3224-192688

-- 
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 http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.