On Sun, Feb 09, 2025 at 03:42:16PM +0100, 'Ralf Hemmecke' via FriCAS - computer 
algebra system wrote:
> > > Unfortunately, that does not replace x by y. :-(
> 
> > This is design choice in current Expression.
> 
> Well, OK, I accept that the third argument is irrelevant for equality.
> But it's also a bit unfortunate, since some people like to see "nice"
> output. I thought that the third parameter was exactly supposed to make that
> heppen, but now the caching system comes into the way. :-(
> Then the third parameter is basically useless and only helps to hide the %A
> kind of variables.

Yes, there is a problem.

> Is there a way to print a sum/product with a pre-specified running variable
> if a different one is already in the cache or do I really have to program
> such a printing function myself?

Currently there is no special support.  Some time ago I wrote about
printing of variables in SparseUnivariatePolynomial.  Current issue
with dummy variables have some similarity.  In both cases it would
be desirable to have "context dependent" output form, but currently
nothing of this included in FriCAS.  In fact, also roots have
similar problem: where FriCAS creates algebraic kernel it gets
name, either user specified or assigned automatically.  Once there
is name all equal kernels will get this name.

Extra thing: if there are no name clashes one could do substitution
in OutputForm using Lisp functions (it would be easy to add a wrapper
so that this is available at Spad level).  I was concerned with
case when there are clashes, is such case one needs to do more.

Also, I wanted this as part of output machinery (expression may be
"lost" after output, so later transformation may be too late).

Thinking more: currently probably simplest solution for you is to
add new operator(s), like product but without dummy variables.

> > If you want different behaviour, there is now KernelCategory,
> > you should be able to define new kind of kernels which behaves
> > differently.
> 
> Do I understand correctly, that one way would be to create MyKernel(X)
> and then coerce the expression into MyKernel and print it.

Well, MyExpression based on MyKernel.  MyExpression now can be a
FunctionSpace2.  There is still work to make FunctionSpace2
acceptable in places where we can use FunctionSpace.  Ideally
Expression would be more general allowing MyKernel intead of
Kernel.

> I guess that would not satisfy my if I have sum(....)*sum(....) since then I
> end up in Expression(...) and therefore again in Kernel (not MyKernel.
> 
> Can I perhaps delete a specific kernel from the Cache?

This in not really feasible.  You could try to delete whole
cache.

> > Alternatively, there were few attempts to create "symbolic"
> > domains, you could use any of them to represent more general
> > expressions, possibly converting to/from Expression to
> > perform actual computations.
> 
> Oh, what are these "symbolic" domains in FriCAS?

Nothing is included in the trunk.  Tim Daly long ago posted IIRC
'CohenAlgebra'.  Bill Page posted a "symbolic algebra" (based on
InputForm).  I created 'IntegerAsNothing' (basically applying
forgetful functor to Integer) and used 'Expression(IntegerAsNothing)'.
I needed pattern matching, so I made a few modifications to Expression
and pattern matching.  I probably send part or all of this to
the mailing list, but IIRC nothing is included in current
FriCAS.

-- 
                              Waldek Hebisch

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

Reply via email to