part(factor(12),1) yields 4, not 2^2.
This is because part (as opposed to inpart) calls
nformat, and nformat drops simp flags.
This is actually not trivial to fix in general, since nformat
does create unsimplified expressions (involving quotient)
which need to be resimplified.
There are two solutions I can think of:
1) Instead of using nformat in part, do the reformatting
on the fly, only creating new unsimplified list structure
where necessary (e.g. part(x*y/z,1)). This is bad
because it means that the logic of nformat would exist in
two different versions, which would have to be kept in
2) Have nformat preserve simp flags to the largest extent
possible. This might appear inconsistent in some
cases, although I don't think there are any such cases
in current Maxima.
I vote for (2).
Log in to post a comment.