I wanted to code something like this twenty years ago. It would have been cumbersome in C but I think a lot more do-able in a reasonable effort in Perl.

The task is really just a bunch of simple text (or tree) transforms, and a set of rules on how to apply them. It has very little to do with math itself.

There are several symbolic math engines out there, but they usually skip the step-by-step proof production. They simplify the expression as far as possible, and stop. If you have source code to these engines, it should be trivial to break it up into an iterative process, returning a set of proof production steps.

Each rule would have a pattern it looks for, and a replacement pattern. Rules should be simple and ordered. Rules should be scanned in the order they are asserted. (Hey, this is sounding more like Prolog now.) Each time you apply a rule successfully, you should start at the top again to see if it can be simplified further.

For maximum benefit, each production in the proof should also explain the mathematical rule it applied. For instance:

(a*(b+c)) (a*b + a*c) -- distribute a to terms b and c

(Sheepishly, I tried to look up an official name for that simple transform on Wolfram's site, but came up empty. Apparently, if it's not some tensor product of primoral eigenvalues, it's too simple for Wolfram to discuss.)

--
[ e d @ h a l l e y . c c ]


In reply to Re: Perl and maths by halley
in thread Perl and maths by ReinhardE

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.