Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you drop out <code>Min</code> and <code>Max</code>, normal forms are easy: they're elements of the field of fractions on your variables, I mean <code>P[Vars]/Q[Vars]</code> where <code>P</code>, <code>Q</code> are polynomials. For Min and Max, I don't know; I suppose the simplest way is to consider them as if/then/else tests, and make them float to the top of your expressions (duplicating stuff in the process), for example <code>P(Max(Q,R))</code> would be rewritten into <code>P(if Q&gt;R then Q else R)</code>, and then in <code>if Q&gt;R then P(Q) else P(R)</code>.</p> <p>I know of two different ways to find normal forms for your expressions <code>expr</code> :</p> <ul> <li><p>Define rewrite rules <code>expr -&gt; expr</code> that correspond to your intuition, and show that they are normalizing. That can be done by directing the equations that you know are true : from <code>Add(a,Add(b,c)) = Add(Add(a,b),c)</code> you will derive either <code>Add(a,Add(b,c)) -&gt; Add(Add(a,b),c)</code> or the other way around. But then you have an equation system for which you need to show Church-Rosser and normalization; dirty business indeed.</p></li> <li><p>Take a more semantic approach of giving a "semantic" of your values : an element in <code>expr</code> is really a notation for a mathematical object that lives in the type <code>sem</code>. Find a suitable (unique) representation for objects of <code>sem</code>, then an evaluation function <code>expr -&gt; sem</code>, then finally (if you wish to, but you don't need to for equality checking for example) a reification <code>sem -&gt; expr</code>. The composition of both transformations will naturally give you a normalization procedure, without having to worry for example about direction of the Add rewriting (some arbitrary choice will arise naturally from your reification function). For example, for polynomial fractions, the semantic space would be something like:</p></li> </ul> <p>.</p> <pre><code> type sem = poly * poly and poly = (multiplicity * var * degree) list and multiplicity = int and degree = int </code></pre> <p>Of course, this is not always so easy. I don't see right know what representation give to a semantic space with Min and Max functions.</p> <p>Edit: Regarding external libraries, I don't know any and I'm not sure there are. You should maybe look for bindings to other symbolic algebra software, but I haven't heard of it (there was a Jane Street Summer Project about that a few years ago, but I'm not sure there was any deliverable produced).<br> If you need that for a production application, maybe you should directly consider writing the binding yourselves, eg. to Sage or Maxima. I don't know what it would be like.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload