Step-by-step equation solving capabilities

69 views
Skip to first unread message

Ted Kosan

unread,
Jul 20, 2015, 11:41:36 PM7/20/15
to sage-...@googlegroups.com
The following topic on ask.sagemath.org indicates that in 2012 Sage
did not have step-by-step equation solving capabilities:

http://ask.sagemath.org/question/8779/how-to-get-intermediate-steps-of-a-solution/

Is Sage still not able to provide the steps a human would typically
take when solving high school level equations? If the answer is “no”,
then why not?

Ted Kosan

rjf

unread,
Jul 21, 2015, 12:31:59 AM7/21/15
to sage-...@googlegroups.com, ted....@gmail.com
I don't know why you are posting this question here --- are you asking
to be flamed?


On Monday, July 20, 2015 at 8:41:36 PM UTC-7, tkosan wrote:
The following topic on ask.sagemath.org indicates that in 2012 Sage
did not have step-by-step equation solving capabilities:

http://ask.sagemath.org/question/8779/how-to-get-intermediate-steps-of-a-solution/

Is Sage still not able to provide the steps a human would typically
take when solving high school level equations?
So far as I know, this is not part of Sage, but I may simply be uninformed.
 
If the answer is “no”,
then why not?
It might not be provided because it is not provided in Maxima, or maybe
in sympy, and that's how Sage does things like this by calling programs
written elsewhere.

I don't know about sympy.  For Maxima, the routines that are used for
solving equations could be traced, either in Lisp or the Maxima language.
This would tell the astute observer how Maxima did the job, which could
be entirely different from  how a student might do the job.  To do the same
task "the student way" would be a largely different program.  Calc101.com
does integration problems for cheaters, showing the work. It apparently
uses Mathematica as a back end, but presumably has a substantial
program that "imitates humans" and that is what cheaters pay for.

By the way, there are obviously a finite number of examples in the
exercises of existing calculus books.  A person or persons could simply
go through them all  (not the odd-numbered ones with answers in the back...)
and write down the solution steps.  Then print them out, for a price.
Students won't even have to type in the problems, just the book, page, problem numbers.

Like   this...
joke number        859

RJF 

Ted Kosan

Ted Kosan

unread,
Jul 21, 2015, 4:51:08 AM7/21/15
to sage-...@googlegroups.com
Richard wrote:

> I don't know why you are posting this question here --- are you asking
> to be flamed?

Even though I left the Sage project in 2007 due to difference of
opinion, I have no desire to harm the Sage project. I think it is
likely that this discussion will contain contentious content that
would not be appropriate or useful to have on sage-devel. I thought
sage-flame would be a safe place to have the discussion.



> It might not be provided because it is not provided in Maxima, or maybe
> in sympy, and that's how Sage does things like this by calling programs
> written elsewhere.

The fact that Maxima does not have high school level step-by-step
equation solving capabilities (which I will refer to as just
step-by-step equation solving from here on) is adequate for the kind
of discussion I have in mind. So, why doesn’t Maxima have this
capability?

My understanding is some of the top math-oriented computer scientists
in the history of computing created Macsyma/Maxima, and top computer
scientists and mathematicians have continued to work on Maxima to the
present date. With the advanced CAS development capabilities that
developers such as these possess, one would think that automating
step-by-step equation solving would be such an easy task for them that
it could be accomplished without too much effort. Yet in the almost
half century since Macsyma was created, it still does not have a
step-by-step equation solver.

One major reason that would probably be given for this omission is
supporting the needs of secondary school mathematics was never one of
the goals for Macsyma/Maxima. However, it does not make sense to me
that during all the time this CAS has been in existence nobody has
added step-by-step equation solving capabilities to it just for fun,
or for their kids, their relative’s kids, or their friend’s kids.

After spending a number of years trying to determine why no open
source CAS I am aware of (except one) contains a step-by-step equation
solver, I have finally identified a reason that makes sense to me. The
reason is related to the following famous quote from Donald Knuth:

"Science is knowledge which we understand so well that we can teach it
to a computer; and if we don't fully understand something, it is an
art to deal with it. Since the notion of an algorithm or a computer
program provides us with an extremely useful test for the depth of our
knowledge about any given subject, the process of going from an art to
a science means that we learn how to automate something."

According to this quote, in order for a developer to create a
step-by-step equation solver that solved equations using steps a human
would typically use, they would need to understand how humans solve
equations by hand well enough to teach it to a computer. I think it is
likely that the reason these kind of open source equation solvers are
so rare is that most CAS developers have little or no understanding of
how manual equation solving actually works.

If this reason is true, I think it leads to some very interesting
possibilities. One possibility that comes to mind is as follows:

Open source CAS project A has implemented a step-by-step equation
solver, and it is battling open source CAS project B for users.
Project B does not have such a solver, and project A could use this
information as a weapon. Project A could attack the reputation of
project B’s developers by stating “Project B’s developer’s
understanding of how math actually works is so poor that they are not
even capable of automating high school level step-by-step equation
solving. If project B’s developers can’t even automate something as
common as high school level step-by-step equation solving, how can
they be trusted to automate mathematics which is more advance than
this?”



> It apparently uses Mathematica as a back end, but presumably has a substantial
> program that "imitates humans" and that is what cheaters pay for.

I think the fact that people are willing to pay for software-based
services that imitate human reasoning would be very useful information
for the people running SageMath Inc. to consider.



> By the way, there are obviously a finite number of examples in the
> exercises of existing calculus books. A person or persons could simply
> go through them all (not the odd-numbered ones with answers in the back...)
> and write down the solution steps. <snip>

In the area of equation solving I have come to see that there is a
huge difference between a person being able to show the steps needed
to solve an equation and understanding (and being able to explain)
exactly the process they used to choose each of the steps and their
order. Looking at even hundreds of written down step-by-step solutions
to equations is not very effective for the purpose of understanding
the process that humans (subconsciously) use to solve equations.



> Students won't even have to type in the problems, just the book, page, problem numbers.

If the hidden rules that humans subconsciously use to solve equations
were taught explicitly, students would not need more efficient ways to
cheat. It turns out these rules are so straightforward to use that it
would be easier for students to just use them to solve the problems
directly than it would be to cheat at all. I don’t think it has
occurred to many math teachers that the main reason large numbers of
students resort to cheating is because the version of math they are
being "taught" has so many critical concepts missing from it that it
is impossible to learn.

Ted

rjf

unread,
Jul 21, 2015, 10:02:02 AM7/21/15
to sage-...@googlegroups.com, ted....@gmail.com
OK, let's discuss this'...


Ted said:

The fact that Maxima does not have high school level step-by-step
equation solving capabilities (which I will refer to as just
step-by-step equation solving from here on) is adequate for the kind
of discussion I have in mind. So, why doesn’t Maxima have this
capability?

Uh, no one who wanted this was willing or able to write the program.
People who were able to write the program had more interesting things
to do.

 

My understanding is some of the top math-oriented computer scientists
in the history of computing created Macsyma/Maxima, and top computer
scientists and mathematicians have continued to work on Maxima to the
present date.

I'm sure those people who work or worked on the program would not
object to being called "top".  
 
With the advanced CAS development capabilities that
developers such as these possess, one would think that automating
step-by-step equation solving would be such an easy task for them that
it could be accomplished without too much effort.

The objective is hardly well-defined.  For example, is there any method
that solves equations not included in SBSES ?
 
Yet in the almost
half century since Macsyma was created, it still does not have a
step-by-step equation solver.

You are invited to write one. 

One major reason that would probably be given for this omission is
supporting the needs of secondary school mathematics was never one of
the goals for Macsyma/Maxima.

Each programmer has his/her own reasons for writing or not writing a particular
program.
 
However, it does not make sense to me
that during all the time this CAS has been in existence nobody has
added step-by-step equation solving capabilities to it just for fun,
or for their kids, their relative’s kids, or their friend’s kids.

Does it also make you wonder why no one at Lockheed, Boeing, or Aerobus
has not built a large scale airplane that flaps its wings?  After all the
wing-flapping mode of air travel is widely used by birds, and in fact
it is even used by some wind-up toys.
 
After spending a number of years trying to determine why no open
source CAS I am aware of (except one) contains a step-by-step equation
solver, I have finally identified a reason that makes sense to me. The
reason is related to the following famous quote from Donald Knuth:

"Science is knowledge which we understand so well that we can teach it
to a computer; and if we don't fully understand something, it is an
art to deal with it. Since the notion of an algorithm or a computer
program provides us with an extremely useful test for the depth of our
knowledge about any given subject, the process of going from an art to
a science means that we learn how to automate something."

Automating equation solving is the task that we understand pretty well.
Automating SBSES is the task that apparently has no fans.
 

According to this quote, in order for a developer to create a
step-by-step equation solver that solved equations using steps a human
would typically use, they would need to understand how humans solve
equations by hand well enough to teach it to a computer. I think it is
likely that the reason these kind of open source equation solvers are
so rare is that most CAS developers have little or no understanding of
how manual equation solving actually works.

I think you are dead wrong.  If you mean "high school problems."
 At least some CAS developers have  written
programs that incorporate as meany techniques as are generally known,
and then a bunch that are not so generally known.  Also some obvious
"naive" methods tend to produce extraneous (erroneous) solutions. 
Or miss some.

In some sense. if your "equations"  include say partial differential
equations, or integral equations or asymptotic equations, 
there are perhaps open scientific questions about
how to solve them.  I doubt that you mean this though,  


If this reason is true, I think it leads to some very interesting
possibilities. One possibility that comes to mind is as follows:

Open source CAS project A has implemented a step-by-step equation
solver, and it is battling open source CAS project B for users.

If that were the case, you would see some activity in this direction.
 
Project B does not have such a solver, and project A could use this
information as a weapon. Project A could attack the reputation of
project B’s developers by stating “Project B’s developer’s
understanding of how math actually works is so poor that they are not
even capable of automating high school level step-by-step equation
solving. If project B’s developers can’t even automate something as
common as high school level step-by-step equation solving, how can
they be trusted to automate mathematics which is more advance than
this?”

The argument is so implausible that it does not serve as motivation for
anyone.
 



> It apparently uses Mathematica as a back end, but presumably has a substantial
> program that "imitates humans" and that is what cheaters pay for.

I think the fact that people are willing to pay for software-based
services that imitate human reasoning would be very useful information
for the people running SageMath Inc. to consider.



> By the way, there are obviously a finite number of examples in the
> exercises of existing calculus books.  A person or persons could simply
> go through them all  (not the odd-numbered ones with answers in the back...)
> and write down the solution steps. <snip>

In the area of equation solving I have come to see that there is a
huge difference between a person being able to show the steps needed
to solve an equation and understanding (and being able to explain)
exactly the process they used to choose each of the steps and their
order. Looking at even hundreds of written down step-by-step solutions
to equations is not very effective for the purpose of understanding
the process that humans (subconsciously) use to solve equations.

I think you misunderstand "subconscious" or you misunderstand "solve".
 



> Students won't even have to type in the problems, just the book, page, problem numbers.

If the hidden rules that humans subconsciously use to solve equations
were taught explicitly,

Uh, then they would be conscious, right?
 
students would not need more efficient ways to
cheat.
You don't understand cheating.  The purpose is to avoid learning.
 
It turns out these rules are so straightforward to use that it
would be easier for students to just use them to solve the problems
directly than it would be to cheat at all.
Nope.
 
I don’t think it has
occurred to many math teachers that the main reason large numbers of
students resort to cheating is because the version of math they are
being "taught" has so many critical concepts missing from it that it
is impossible to learn.

Nope.  Students dislike math. It makes their head hurt. They just want to
graduate.  Besides which, solving equations given to students in high school
is easy and is taught step by step.  

RJF

PS you were right to post on sage flame.

Bill Hart

unread,
Jul 21, 2015, 10:21:41 AM7/21/15
to sage-flame, ted....@gmail.com
This is totally outside of my area. But I'm curious...

Ted, which "step-by-step" equations did you want sage/maxima to solve?

Are you simply talking about linear equations and quadratics that high school students might encounter, or are you talking about something much more sophisticated, e.g. something which can step-by-step do integrals, derivatives, solve differential equations, deal with special functions, find modular equations, etc., etc.?

The problem with the former is probably that it would take students so much longer to learn python, the special syntax that would be required to enter the equations as symbolic expressions and how to use the step-by-step tool, that it doesn't make much sense to implement it. It wouldn't get used. It's a nice gimmick perhaps....

The latter sounds like an unsolved research problem.

Bill.

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

Bill Hart

unread,
Jul 21, 2015, 10:30:00 AM7/21/15
to sage-flame, ted....@gmail.com
Just as a follow-up, here is an example of a high school problem taught to students just under 2000 years ago (from Diophantus' book):

Q. Find rational numbers x, y, z such that xy +/- k, xz +/- k, yz +/- k are squares, where k = x + y + z.

I'd be interested to know how Mathematica and Maple solve this step-by-step.

Bill.


Richard Fateman

unread,
Jul 21, 2015, 2:26:41 PM7/21/15
to sage-...@googlegroups.com
I'm not sure what you mean by +/-k but ...

[z+x*y+y+x=a^2,x*z+z+y+x=b^2,y*z+z+y+x=c^2]
solve(%,[x,y,z])

but Maxima can't solve it in that form. However, if a=b=c=1, there are

solutions
(%o14)
[[x=-(2*sqrt(13)-8)/(sqrt(13)-1),y=(sqrt(13)-3)/2,z=-(5*sqrt(13)-17)/(sqrt(13)-7)]
,[x=-(2*sqrt(13)+8)/(sqrt(13)+1),y=-(sqrt(13)+3)/2,z=-(5*sqrt(13)+17)/(sqrt(13)+7)],
[x=1,y=0,z=0],
[x=0,y=1,z=0],
[x=0,y=0,z=1]]

RJF

Bill Hart

unread,
Jul 21, 2015, 2:54:51 PM7/21/15
to sage-flame
I should have mentioned that Diophantus always meant positive rational solutions in all his problems. So the solutions Maxima gives would not be valid.

--
You received this message because you are subscribed to the Google Groups "sage-flame" group.

Bill Hart

unread,
Jul 21, 2015, 2:58:48 PM7/21/15
to sage-flame
Oh, and by +/- I mean plus or minus, meaning that both values must be squares.

Bill.

Richard Fateman

unread,
Jul 21, 2015, 2:58:52 PM7/21/15
to sage-...@googlegroups.com
On 7/21/2015 11:54 AM, 'Bill Hart' via sage-flame wrote:
> I should have mentioned that Diophantus always meant positive rational
> solutions in all his problems. So the solutions Maxima gives would not
> be valid.
It's not obvious to me how to express this in Maxima. RJF


Bill Hart

unread,
Jul 21, 2015, 3:00:04 PM7/21/15
to sage-flame
Guess we'll have to go back to solving it on papyrus then. Maybe for another 2000 years.

Ted Kosan

unread,
Jul 21, 2015, 3:41:48 PM7/21/15
to sage-...@googlegroups.com
Richard wrote:

>> Yet in the almost half century since Macsyma was created, it still does not
>> have a step-by-step equation solver.
>
> You are invited to write one.

After I have finished a step-by-step equation solver I am writing for
MathPiper, I may be interested in writing one for Maxima if you agree
to help me.



> Does it also make you wonder why no one at Lockheed, Boeing, or Aerobus
> has not built a large scale airplane that flaps its wings? After all the
> wing-flapping mode of air travel is widely used by birds, and in fact
> it is even used by some wind-up toys.

If the governments of the world mandated that all of their citizens
were required to fly in aircraft that only used the wing-flapping mode
of air travel for a 10 year period before they were permitted to fly
in more advanced aircraft, Lockheed, Boeing, and Airbus would probably
all build large scale airplanes that flaps their wings, and they would
probably also lobby relentlessly to have this mandate removed.



> You don't understand cheating. The purpose is to avoid learning.
> <...>
> Students dislike math. It makes their head hurt. They just want to
> graduate.

What students dislike is not math because they are not being taught
math. What are they being taught that is being called math? I don’t
know. What would the game be called that operated exactly like chess,
except the rules for how the pieces are moved were never written down
and never taught explicitly? Lets call it c_es_. One critical ability
that is needed to be good at c_es_ that is not needed for being good
at chess is figuring out how the pieces are moved by only observing
how other people move them. I don’t think one can conclude that people
who hate c_es_ also hate chess.

I also think it would be unsurprising if students who were forced to
“learn” c_es_ without being taught its rules and then were graded on
their ability to play it well would resort to cheating.

Ted

Richard Fateman

unread,
Jul 21, 2015, 4:23:45 PM7/21/15
to sage-...@googlegroups.com
On 7/21/2015 12:41 PM, Ted Kosan wrote:
> Richard wrote:
>
>>> Yet in the almost half century since Macsyma was created, it still does not
>>> have a step-by-step equation solver.
>> You are invited to write one.
> After I have finished a step-by-step equation solver I am writing for
> MathPiper, I may be interested in writing one for Maxima if you agree
> to help me.
There is a Maxima mailing list to which you can subscribe and where you
can ask questions. Specific questions like "how do I move expressions
from the left to the right side of an equation" will get answered, if you
can't figure it out from the manual. Questions like "Tell me how to
write a step by step "solve" "
probably not so much.

>
>
>> Does it also make you wonder why no one at Lockheed, Boeing, or Aerobus
>> has not built a large scale airplane that flaps its wings? After all the
>> wing-flapping mode of air travel is widely used by birds, and in fact
>> it is even used by some wind-up toys.
> If the governments of the world mandated that all of their citizens
> were required to fly in aircraft that only used the wing-flapping mode
> of air travel for a 10 year period before they were permitted to fly
> in more advanced aircraft, Lockheed, Boeing, and Airbus would probably
> all build large scale airplanes that flaps their wings, and they would
> probably also lobby relentlessly to have this mandate removed.
If your problem is with the education system, then try to fix that.
If your problem is how to write a program to solve math problems,
you can do that.

RJF

>
>
>
>> You don't understand cheating. The purpose is to avoid learning.
>> <...>
>> Students dislike math. It makes their head hurt. They just want to
>> graduate.
> What students dislike is not math because they are not being taught
> math.
No, some students resist all forms of intellectual work.

Ted Kosan

unread,
Jul 22, 2015, 3:10:08 AM7/22/15
to sage-...@googlegroups.com
Richard wrote:

> There is a Maxima mailing list to which you can subscribe and where you
> can ask questions. Specific questions like "how do I move expressions
> from the left to the right side of an equation" will get answered, if you
> can't figure it out from the manual. Questions like "Tell me how to write a step by step "solve" "
> probably not so much.

The types of questions I would be interested in asking are more
related to things like Maxima’s pattern matcher. For example, I assume
that Maxima’s main pattern matcher knows about the commutativity and
associativity of addition and multiplication. For an
education-oriented step-by-step equation solver, it may be better to
have commutativity and associativity handled by rewrite rules so these
operations can be recorded by the same mechanism that is recording the
use of the solver's other rewrite rules.

If it is better to keep the handling of commutativity and
associativity in the pattern matcher, then I will need to modify
Maxima’s pattern matcher so that it can record its uses of
commutativity and associativity. If it is better to have commutativity
and associativity handled by rewrite rules, then I will probably need
to write a pattern matcher from scratch which is specifically designed
for the needs of this equation solver.

Guidance from an expert who has experience with implementing CAS
components like this is what it would be helpful for me to have.



> If your problem is with the education system, then try to fix that.
> If your problem is how to write a program to solve math problems,
> you can do that.

My main problem (and one of the main problems for the well being of
all computer algebra system projects) is indeed with the extremely
obsolete education system. I think it would be easier to replace the
education system than it would be to fix it. I think an
education-oriented CAS that contains a high school level step-by-step
equation solver can be the foundation upon which a replacement effort
like this can be constructed. I intend to begin such an effort in the
near future, and one of the reasons for why I submitted this post to
sage-flame is to make some critical members of the Sage and Maxima
projects aware of this plan.


Ted

Richard Fateman

unread,
Jul 22, 2015, 10:05:04 AM7/22/15
to sage-...@googlegroups.com
On 7/22/2015 12:10 AM, Ted Kosan wrote:
> Richard wrote:
>
>> There is a Maxima mailing list to which you can subscribe and where you
>> can ask questions. Specific questions like "how do I move expressions
>> from the left to the right side of an equation" will get answered, if you
>> can't figure it out from the manual. Questions like "Tell me how to write a step by step "solve" "
>> probably not so much.
> The types of questions I would be interested in asking are more
> related to things like Maxima’s pattern matcher.

Judging from the rest of the message below, you are missing the boat.
You want to remove all automatic steps and make them explicit.
Therefore you cannot use the "automatic" simplifier. Therefore you
do not need a computer algebra system, but a rule-following mechanism
plus a bunch of rules plus a "trace". See for example, PRESS
(or commentary on it)
http://dl.acm.org/citation.cfm?id=43879

Such an actual set of steps would be so long and dull for most problems
that students would certainly discard it as a learning mechanism. I
doubt then that it would serve the purpose you have in mind, namely
to revolutionize mathematics education.

I agree that the tradition of teaching by example looks really bad compared
to the idea that one should teach algorithms for solving problems,
and that mathematics as taught in school is wasteful for the prepared
mind. I think the assumption is that most minds are better served by
rote repetition. After all, when one has learned to add 3 digit numbers,
must one then learn how to add 4 digit numbers?

But getting back to your task. You could look at PRESS, a prolog program.
or maybe SNOBOL, for that matter. PRESS, as I recall, has "meta"
methods like "isolate the unknown on one side" and "collect terms".
So this may be what you think of as steps worth elucidating.

It is not a great way to write a general simplifier. Stages in
such a program (like "evaluate all explicit arithmetic", "factor") are
not human-like step-by-step.

So my advice is to go read about PRESS. If it solves your
problems, go on to something else.
RJF

Ted Kosan

unread,
Jul 22, 2015, 10:36:40 AM7/22/15
to sage-flame
I just realized that my following two replies to Bill were sent only
to Bill by mistake.


Bill wrote:

> Ted, which "step-by-step" equations did you want sage/maxima to solve?
>
> Are you simply talking about linear equations and quadratics that high school
> students might encounter, or are you talking about something much more
> sophisticated <snip>

I am currenting interested in step-by-step equation solvers that
produce real number solutions that are constructed from real numbers,
arbitrary constants, variables, and all the functions that are
typically taught in high school algebra including trigonometric,
inverse trigonometric, exponential, and logarithmic functions. The
solver must also be able to work under certain assumptions (or
preconditions) about the arbitrary constants.

I don’t currently need step-by-step equation solving implemented in
sage/maxima because I already have access to a wonderful open source
equation solver named PRESS
(http://dream.inf.ed.ac.uk/software/press/). Here is an example of
PRESS solving an equation:

In> solve(log(2,x) + 4*log(x,2) = 5).

Solving log(2, x) + 4 * log(x, 2) = 5 for x

Offending set is [log(2, x), log(x, 2)]

Reduced term is _G390

Rewriting equation in terms of log(2, x)
gives log(2, x) + 4 * log(2, x) ^ -1 = 5

Substituting x1 for log(2, x) gives
4 * x1 ^ -1 + x1 = 5

Multiply through by x1 to get

x1 ^ 2 + -5 * x1 + 4 = 0

Using quadratic equation formula

Solutions are x1 = 4 and x1 = 1

Applying substitution
x1 = log(2, x)
to :
x1 = 4 # x1 = 1
gives :
log(2, x) = 4 # log(2, x) = 1

Solving disjunct log(2, x) = 4

x = 16
(by Isolation)

Solving disjunct log(2, x) = 1

x = 2
(by Isolation)

Answer is :
(X1 # X2)
where :
X1 = x = 16
X2 = x = 2



> The problem with the former is probably that it would take students so
> much longer to learn python, the special syntax that would be required
> to enter the equations as symbolic expressions and how to use the
> step-by-step tool, that it doesn't make much sense to implement it.
> It wouldn't get used. It's a nice gimmick perhaps....

I am currently in the process of implementing PRESS’s approach to
step-by-step equation solving in MathPiper. Here are some experimental
examples of MathPiper solving simple equations (note: assumptions are
not shown in these examples):

http://patternmatics.com/examples/expressions/stepbystep/single_unknown/

I had a class of high school students work with this experimental
version of the step-by-step equation solver a couple of years ago, and
the mostly positive feedback on it that they provided leads me to
think students would probably use solvers like this without being
forced to:

http://patternmatics.com/research/student_feedback/student_feedback_spring_2013.html

Ted


=============

Bill wrote:

> But I notice it solves log(2, x) = 1 by isolation. Does it mean by real root isolation?

The following excerpt from the paper “Using Matching in Algebraic
Equation Solving” (Bundy, 1981) contains a short description of what
PRESS means by “isolation”:

---------------
“The PRESS solutions constitute a rational reconstruction of part of
the history of algebra: we are not saying that this is how these
solutions were first discovered, but that our program does show how
they could have been discovered by a rational process of analysis of
the problem, in terms of the tools available for its solution.

PRESS uses multiple sets of rewrite rules, employing meta-level
reasoning and descriptions to guide that application and hence control
search. Some of the important rewrite rule sets are:

Isolation - PRESS tries applying isolation rules when there is a
single occurrence of the unknown in the equation. Isolation rules are
applied to strip away surrounding functions and operators from the
unknown, finally resulting in an equation with the unknown on one side
by itself, and some expression (free of the unknown) on the other. A
typical isolation rule is
arcsin(x)=e -> x=sin(e).

Collection - Collection rules serve to reduce the number of
occurrences of the unknown, so that isolation can be applied. A
typical collection rule is
u*w + v*w —> (u+v)*w
which collects relative to w.

Attraction - Attraction rules move occurrences of the unknown closer
together in the expression tree, so that perhaps a collection rule can
be applied. A sample rule is
log(b,u)+log(b,v) -> log(b,u*v),
where log(b,u) denotes the log of u to the base b.”
---------------

The following are some of the simpler isolation rewrite rules from
PRESS’s source code:

/* AXIOMS FOR ISOLATION*/
/* FIRST ARGUMENT IS THE VARIABLE ISOLATED*/

/* unary minus */
isolax( 1 , -U=V , U= -1*V , true ).

/* plus */
isolax( 1 , U+V=W , U=W+(-1)*V , true ).
isolax( 2 , V+U=W , U=W+(-1)*V , true ).

/* multiplication */
isolax( 1 , U*V=W , U=W*V1 , non_zero(V) ) :- tidy(1/V,V1).
isolax( 2 , V*U=W , U=W*V1 , non_zero(V) ) :- tidy(1/V, V1).

/* logarithms */
isolax( 1 , log(U,1)=0 , U=N , arbint(N) ).
isolax( 1 , log(U,V)=W , U=V^W1 , non_zero(W) ) :- tidy(1/W,W1).
isolax( 2 , log(U,V)=W , V=U^W , true ) .


Ted

rjf

unread,
Jul 22, 2015, 10:58:59 AM7/22/15
to sage-flame, ted....@gmail.com
Aha, so you know about PRESS.
Maybe you should read my review of it (and there was also a response by Bundy etal)

I looked at your student feedback and your pictures.  It seems that the major
advantage to your work is that students end up understanding the precedence of
operators like +, *, /, =.   This is a result of showing the expressions in trees.

I think that this precedence business is a possible cause for distress, but
most students get over it, and even seem to enjoy it.  Otherwise they would
be more attracted to Lisp, where the precedence of operations is obvious.

Anyway, building on top of PRESS, in my opinion, is unappealing mathematically.
Incorporating PRESS into a computer algebra system somehow, as some kind
of "meta level" is also unappealing, at least to me.  Note however that there are
prolog language implementations in Lisp, and so PRESS could, at least in principle,
just be read in to Maxima.
I don't know how one goes about "calling Maxima" from such an arrangement.

A controlled experiment, where some students used your computer program and
others didn't, followed by a written test to see if there was a difference in what they
learned, would be much more convincing than a collection of student comments
like "it was cool".

RJF

Bill Hart

unread,
Jul 22, 2015, 11:03:38 AM7/22/15
to sage-flame, Ted Kosan
I also thought the student comments were not terribly meaningful. These could easily be generated by asking the following set of questions:

Q1. What was your least favourite part of this exercise.

Q2. What was the best part about using the software provided.

and then discarding the answers to Q1. (I'm not suggesting that happened. It's just that surveys can be made to say anything.)

Bill.

--
You received this message because you are subscribed to the Google Groups "sage-flame" group.

Richard Fateman

unread,
Jul 22, 2015, 11:10:48 AM7/22/15
to sage-...@googlegroups.com
Oh, here's an article about solving, commenting
on PRESS, Macsyma. Maple, Mathematica...

it could be viewed as basically hammering on PRESS, but
I think it addresses the deficiencies of the approach.

http://www.cs.berkeley.edu/~fateman/papers/solving.pdf

Ted Kosan

unread,
Jul 22, 2015, 1:15:31 PM7/22/15
to sage-flame
Bill wrote:

> I also thought the student comments were not terribly meaningful. These could easily
> be generated by asking the following set of questions:
>
> Q1. What was your least favourite part of this exercise.
>
> Q2. What was the best part about using the software provided.
>
> and then discarding the answers to Q1. (I'm not suggesting that happened. It's just
> that surveys can be made to say anything.)

I agree these student comments are not very meaningful. However, the
software I am writing is partially based on research that is described
in the following short paper, which is titled “Computer Presentations
of Structure in Algebra” and which contains more meaningful results:

http://pat-thompson.net/PDFversions/1987StrucInAlg.pdf

I am in the process of writing a browser-based application that
contains functionality that is similar to the program which was
created for this research project. After it is done I plan to use it
to start conducting actual research which will build on the research
described in this paper. Here is a link to the expression tree part of
the application I am writing if you are interested in playing with it:

http://patternmatics.com/test/expression_structure.html

By the way, the program described in the paper is written in Lisp. A
number of years ago Richard submitted some posts to sage-devel which
contained compelling reasons for why current CAS developers should
learn Lisp. I didn’t know who Richard was at the time, but when I
researched him on the web I learned he was one of the fathers of the
computer algebra system. I decided this was reason enough to act on
his advice and learn Lisp.

I can say without reservation that this was some of the best advice I
have ever received. One of the many great benefits of knowing at least
some Lisp for a CAS developer is that it gives them access to a
treasure trove of CAS research that was done in the 1960s, 70s, and
80s. This research paper is one of the many treasures which are in
this trove.

A few years after I had learned some Lisp, a CAS newbie asked on
sci.math.symbolic for ways to learn how CASs worked. In part of
Richard’s response to this question he advised the person to learn
Prolog. Since Richard’s advice about learning Lisp turned out to be
excellent, I figured his advice about learning some Prolog was
probably good too. So, I spent a number of years learning Prolog, and
part of the fruit from this effort was gaining access to a treasure
trove of classic AI research. The research papers on PRESS are among
the many treasures in this second trove.

Ted

Bill Hart

unread,
Jul 22, 2015, 1:52:44 PM7/22/15
to sage-flame
Ah, now we are into classical sage-flame territory!


Ted

--
You received this message because you are subscribed to the Google Groups "sage-flame" group.

Ted Kosan

unread,
Jul 25, 2015, 3:28:36 PM7/25/15
to sage-...@googlegroups.com
Richard wrote:

> Anyway, building on top of PRESS, in my opinion, is unappealing
> mathematically. Incorporating PRESS into a computer algebra system
> somehow, as some kind of "meta level" is also unappealing, at least to me.

I think it would be helpful if I explained what I am interested in
using PRESS for. In May of 2008 you submitted your Sage-related
“standing on the toes of giants” post to the Maxima list. In the
conclusion of this post you made the following statement:

“I think that people with the skill set for advancing computer algebra
systems and scientific computing generally are unusual, and that
(after an educational process that may involve courses, reading,
programming), such people should be encouraged to advance the state of
the art, not duplicate it.”

This thought made great sense to me. I was inspired by it to try to
figure out a way to provide these unusual people with the education
they would need to achieve your goal of advancing the state of the art
in computer algebra systems. I decided that one way to educate these
people was to get an mid-level Lisp-based CAS into their hands, teach
them how it worked at a deep level and, when they had outgrown it,
move them up to a state of the art CAS like Maxima or Reduce.
MathPiper is a mid-level Lisp-based CAS, and this is one of the main
goals I set for MathPiper in 2008.

I observed that your attempts to convince the current generation of
CAS developers to learn Lisp (so they could actually stand on the
shoulders of CAS giants) were mostly unsuccessful. I figured if you
had difficulty convincing developers (who already had favorite
programming languages) to learn Lisp, a nobody like me would have no
chance at all. From this I concluded that I needed a way to reach
future CAS developers before they knew how to program. This meant I
needed to figure out a way to reach these unusual people while they
were still in high school or even middle school.

At the university where I work, I teach an introduction to programming
class to incoming freshmen (and sometimes to high school juniors and
seniors) each fall semester. In the fall of 2008 I started teaching
MathPiper in this class, and every year since then I have modified
MathPiper (sometimes heavily) so it increasingly met the beginning
programming and CAS needs of high school students and college
freshmen. MathPiper has reached the point where it works fairly well
as a first programming language.

I plan to use what I think of as a “Trojan pinata” strategy for
transitioning the unusual students you mentioned from MathPiper to a
more advanced CAS. I removed most of the deeper computer algebra code
from MathPiper and then modified it to wrap around and use a more
advanced CAS for more advanced tasks. In the list of student feedback
I posted earlier there were indeed a number of students who thought
the software I showed them was “cool”. However, there was one student
who asked “How is this working?”. I think this might indicate this
student is one of the unusual students we are looking for. When a
student asks how the deeper parts of MathPiper are working, they can
be guided through cracking MathPiper open so they can begin learning
about the more advanced CAS treasure/payload it contains. It does not
matter if these students never use MathPiper again because it is
specifically designed to be a training wheels CAS which is discarded
when it is no longer needed.

MathPiper currently uses Reduce as its payload CAS, but it would be
nice for the payload CAS to be Maxima. As an aside, I needed to do
some substantial modifications to Reduce to have it work as a
computation engine for another CAS. Arthur Norman was kind enough to
provide me with a summary explanation of the Reduce codebase before I
started the modification effort, which was very helpful.

Now that I have provided some information about one of the main goals
I am trying to achieve with MathPiper, I can more easily explain what
I am planning to use PRESS for. A few years ago a mathematics
assessment researcher (whose assessment software used Maxima) told me
something along the lines that most postsecondary teachers could not
use MathPiper in their classrooms because it did not show the
psychologically plausible steps it took to solve a given equation.
This fact was a major obstacle for the goal I had for MathPiper.
Fortunately, he also told me about the existence of a psychologically
plausible entry-level CAS named PRESS, and he suggested that I look
into it.

After studying PRESS for awhile, I decided it could be used as part of
a second Trojan pinata strategy which would make it easier to
introduce MathPiper into postsecondary schools. In this instance of
the strategy, the entry-level PRESS CAS is the pinata and MathPiper is
the payload. Just as it is essential for MathPiper to be limited to
encourage unusual students to break it open and discard it, it is
essential for PRESS to be limited to encourage students to break it
open and discard it. However, instead of using PRESS itself and
wrapping it around MathPiper, I am in the process of just implementing
in MathPiper the parts of PRESS that are useful for the purpose they
need to serve. I am also modifying and extending these parts to be
more useful in an educational setting.

The more I work with PRESS, the more it appears to be well suited for
this purpose. There are over 12 papers that have been written on PRESS
and at least three books which contain discussions of it. This
literature, along with literature that is related to it, contains a
wealth of information on this entry-level CAS which is essential to
know for students who will eventually be advancing the state of the
art in computer algebra systems. The following are some of the ideas
that are discussed in this literature:

Algorithm = logic + control.
Computation = controlled deduction.
Formal languages.
Formal logic.
Mathematical logic.
Object language.
Meta-language.
Lambda abstraction.
Decision procedures.
Guided search.
Pattern matching
Rewrite rules.
etc.

I hope to be able to incorporate information like this into the
educational materials I will be writing for the
“PRESS/MathPiper/Advanced CAS” system which can be understood by
7th-12h graders.

In your “toes” post you mentioned an educational process which will
teach unusual students the knowledge and skills that are needed to
work on a state of the art CAS. If you have any ideas on the
information these students should learn in such a process, and the
order in which it should be learned, I would be very interested in
seeing them.

Ted
Reply all
Reply to author
Forward
0 new messages