Why do you find it interesting? 'box' and 'paren' are just kernels
with no automatic simplifications. On output 'box' is invisible but
'paren' displays as parenthesis. As with all kernels in Expression the
arguments of the kernel are themselves members of Expression
(recursively). This seems to be of limited usefulness to me - a kind
of a hack to avoid some forms of autosimplification. 'distribute' just
evaluates 'box' and 'paren' as identities (selectively in the two
argument for). I rather think that it attempts to solve the problem at
the wrong level.

On 29 January 2017 at 22:37, Kurt Pagani <[email protected]> wrote:
> I wasn't aware of "box" or "paren" in EXPR INT. That's really interesting.
> Apparently "distribute" reliably works as advertised:
>
>   distribute(f) expands all the kernels in f that are formally enclosed by a
> box or paren expression.
>
> I've tried to figure out what "box" is actually doing. By (17) and (18)
> below I would bet it's like "invisible parentheses"?
>
> (1) -> paren(a+b)*(a+b)
>
>    (1)  (b + a)(b + a)
>                                                     Type:
> Expression(Integer)
> (2) -> distribute %
>
>          2           2
>    (2)  b  + 2a b + a
>                                                     Type:
> Expression(Integer)
> (3) -> kernels %
>
>    (3)  [b,a]
>                                       Type:
> List(Kernel(Expression(Integer)))
>
> (4) -> kernels (paren(a+b)*(a+b))
>
>    (4)  [(b + a),b,a]
>                                       Type:
> List(Kernel(Expression(Integer)))
>
> (5) -> kernels (paren(a+b)*(a+b)).1
>
>    (5)  (b + a)
>                                             Type:
> Kernel(Expression(Integer))
> (6) -> name %
>
>    (6)  %paren
>                                                                  Type:
> Symbol
>
>
> ...
>
> (13) -> paren(a*(b+c))
>
>    (13)  (a c + a b)
>                                                     Type:
> Expression(Integer)
> (14) -> paren(a*paren(b+c))
>
>    (14)  (a(c + b))
>                                                     Type:
> Expression(Integer)
> (15) -> distribute %
>
>    (15)  a c + a b
>                                                     Type:
> Expression(Integer)
> (16) -> box(a*(b+c))
>
>    (16)  a c + a b
>                                                     Type:
> Expression(Integer)
> (17) -> box(a*box(b+c))
>
>    (17)  ac + b
>                                                     Type:
> Expression(Integer)
> (18) -> distribute %
>
>    (18)  a c + a b
>                                                     Type:
> Expression(Integer)
>
>
>
> On Friday, 27 January 2017 17:04:45 UTC+1, Waldek Hebisch wrote:
>>
>> Constantine Frangos wrote:
>>
> ...
>
>>
>> Some people want to stop transformation of expressions to get
>> desired output for printing expressions.  In FriCAS you can
>> use box and paren:
>>
>> (9) -> x*(y + x)
>>
>>                2
>>    (9)  x y + x
>>                                                     Type:
>> Polynomial(Integer)
>> (10) -> x*box(x+z)
>>
>>    (10)  xz + x
>>                                                     Type:
>> Expression(Integer)
>> (11) -> x*paren(x+z)
>>
>>    (11)  x(z + x)
>>                                                     Type:
>> Expression(Integer)
>>
>> FriCAS will keep content of box (or paren) together.  Box prints without
>> parenthesis which is appropriate for sums, but as (10) above shows
>> is confusing for products.  Note: if you want to do computations
>> with then note that in most cases you need to remove them by
>> hand if you want to combine content with what is outside.
>>
>> --
>>                               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 [email protected].
> To post to this group, send email to [email protected].
> 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to