Re: [fricas-devel] Noncommutative factorization

2018-11-16 Thread Bill Page
Waldek,

On Sat, Nov 10, 2018 at 12:02 PM you wrote:
>
> One update to what I wrote before.  In
>
> J. P. Bell, A. Heinle, and V. Levandovskyy,
> On Noncommutative Finite Factorization Domains,
> Trans. Amer. Math. Soc. 369 (2017), 2675-2695
>
> there is proof of finite number of factorizations.
>
> I have now implemented the lift part of Davenport-Caruso method.
> ...

Since the number of factorizations of a non-commutative polynomial
over a unique factorization domain is finite but not unique there may
be some applications where it maybe interesting to know more than one
or even all possible factorizations. Your current implementation
produces just one factorization. Do you see any opportunity to extend
the Davenport-Caruso method to produce multiple factorizations or a
complete enumeration of factorizations?

I did some experiments with the xdpolyf1 factorizer to produce such
multiple factorizations. This was relatively easy since the solution
algorithm (with the "pruning" heuristic) naturally produces
factorizations in which either the left factor or right factor at each
step has a minimum number of terms. By alternately choosing to
minimize first the right factor and then the left factor it is
possible to explore alternate factorizations. I did not get so far as
to attempt to prove completeness.

-- 
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] [PATCH] fix 'children' in List, Stream and Tree

2018-11-16 Thread oldk1331
On Fri, Nov 16, 2018 at 10:07 PM Waldek Hebisch
 wrote:
>
> That is the point: normal case is that we check before using
> 'children' and error in 'childern' is to catch bugs
> (missing check).  That is why I ask if you have use
> case when we want call without check and empty return is
> OK.

That makes sense, I'll make changes to code and documentation
accordingly.

One reason I didn't mention is that, "rest" doesn't give error when
argument is empty list, I was influenced by that.  What's your
opinion on this function?

(BTW, in Scheme "(cdr '())" gives error while in Common Lisp
it gives NIL.)

> Note that "it's hard to handle error in SPAD" only counts
> when 'childern' wants to signal error, but operation
> is in fact correct.
>
> --
>   Waldek Hebisch
>
> --
> You received this message because you are subscribed to the Google Groups 
> "FriCAS - computer algebra system" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to fricas-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to fricas-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/fricas-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
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] [PATCH] fix 'children' in List, Stream and Tree

2018-11-16 Thread Waldek Hebisch
Ralf Hemmecke wrote:
> 
> What I find definitely bad is to give the burden of checking to both the
> function and the caller, by letting the specification be unclear about
> special cases.
> 
> http://fricas.github.io/api/GcdDomain.html#l-gcd-domain-gcd
> 
>   gcd(x, y) returns the greatest common divisor of x and y.
> 
> What will gcd(0,0) return in FriCAS?
> 
> That it returns 0 is OK with the definition:
> 
>d=gcd(a,b) if and only if for all c: c|a and c|b â š c|d.
> 
> where
> 
>x|y stands for "there exists an integer k such that k*x=y".
> 
> I guess most people expect gcd(0,0) to be undefined.
> 
> See also https://math.stackexchange.com/questions/495119/what-is-gcd0-0

The last reference explains it quite well: greatest is with
respect to divisibility and the definition gives 0 for gcd(0, 0).
So nothing undefined.

More generaly, when definition has natural and useful extention
going beyond "usual" cases it makes sense to use more general
definition.

To put it differently: sometimes definitions force unnatural
case splits, I prefer to avoid them.  OTOH there are natural
case splits and 'children' seem to fall into this category.

BTW: I tolerate double checking to some degree.  Namely, it
is easy to place check in 'children' (signaling error), but
logic usualy requires earlier check.  Such earlier check
may be easily forgotten and lead to bugs.  Check in
'children' would be redundant in correct code, but
in real life helps in finding bugs.

-- 
  Waldek Hebisch

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


Re: [fricas-devel] [PATCH] fix 'children' in List, Stream and Tree

2018-11-16 Thread Waldek Hebisch
oldk1331 wrote:
> I have a few reasons:
> 
> 1. I prefer to have fewer "error" in library, it's hard
> to handle error in SPAD, and it makes function not "total"
> (it doesn't return a value for certain inputs), that's a
> bad property.
> 
> 2. If we have error for "children", then what about "leaf?"
> and many other functions?  So I prefer to treat empty
> as a special case and give a return value for it.
> Anyway, in real code, we already check for empty before
> doing things.

That is the point: normal case is that we check before using
'children' and error in 'childern' is to catch bugs
(missing check).  That is why I ask if you have use
case when we want call without check and empty return is
OK.

Note that "it's hard to handle error in SPAD" only counts
when 'childern' wants to signal error, but operation
is in fact correct.

-- 
  Waldek Hebisch

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