Re: solve and the facts database

Stavros Macrakis <[email protected]> Mon, 13 Jul 2026 22:08:18 -0400
Newsgroups gmane.comp.mathematics.maxima.general
Message-ID <CACLVabV=avXZeCQiSaZ3kT5dmXfHemsGQQm14JVJj4D7F6YN=w@mail.gmail.com>
--===============2495324845191444374==
Content-Type: multipart/alternative; boundary="000000000000e3bf50065688ae91"

--000000000000e3bf50065688ae91
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Much of Maxima (not just solve) ignores assume facts and post-filtering is
a very partial solution.

Consider solve(x=3Dx+a,x) where equal(a,0). That should give *all*, right?
But instead it gives *[]*, the exact opposite, and post-filtering can't fix
that.

Or how about solve(x=3Dx, x) where x>1? Solve today never returns
inequalities so there is no way of expressing the result without breaking
the interface.

%solve (in to_poly_solve) deals with issues like this much better, but at
the cost of a harder to understand output format.

So I would not recommend an incomplete integration of solve with assume.
Let's improve %solve instead.

    -s

On Mon, Jul 13, 2026, 17:15 Raymond Toy <[email protected]> wrote:

> On 7/13/26 6:15 AM, David Scherfgen via Maxima-discuss wrote:
>
> Dear all,
>
> I noticed that solve doesn't seem to use the facts database to filter
> solutions.
>
> For example:
>
> (%i1) assume(x > 0)$
> (%i2) solve(x^2 =3D 4);
> (%o2) [x =3D -2, x =3D 2]
>
> Should this be considered a bug?
>
> I thought it was documented that solve doesn=E2=80=99t use the database, =
but I
> can=E2=80=99t find any such statement. Maybe that=E2=80=99s just the gene=
ral understanding
> of what solve does?
>
>
> Should solve be modified so that it rejects all solutions that contradict
> the facts database?
> Maybe make it optional to not break existing code?
>
> Probably make it optional? Maybe be adding a new function to apply the
> database to the results returned from solve?
> &#8203;
> _______________________________________________
> Maxima-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/maxima-discuss
>

--000000000000e3bf50065688ae91
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div dir=3D"auto">Much of Maxima (not just solve) ignores=
 assume facts and post-filtering is a very partial solution.=C2=A0</div><di=
v dir=3D"auto"><br><div dir=3D"auto">Consider solve(x=3Dx+a,x) where equal(=
a,0). That should give <b>all</b>, right? But instead it gives <b>[]</b>, t=
he exact opposite, and post-filtering can&#39;t fix that.=C2=A0</div><div d=
ir=3D"auto"><br></div><div dir=3D"auto">Or how about solve(x=3Dx, x) where =
x&gt;1? Solve today never returns inequalities so there is no way of expres=
sing the result without breaking the interface.</div><div dir=3D"auto"><br>=
</div><div dir=3D"auto">%solve (in to_poly_solve) deals with issues like th=
is much better, but at the cost of a harder to understand output format.=C2=
=A0</div><div dir=3D"auto"><br></div><div dir=3D"auto">So I would not recom=
mend an incomplete integration of solve with assume. Let&#39;s improve %sol=
ve instead.=C2=A0</div><div dir=3D"auto"><br></div><div dir=3D"auto">=C2=A0=
 =C2=A0 -s</div></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr"=
 class=3D"gmail_attr">On Mon, Jul 13, 2026, 17:15 Raymond Toy &lt;<a href=
=3D"mailto:[email protected]" target=3D"_blank" rel=3D"noreferrer">toy.=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote"=
 style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u=
></u>

 =20

   =20
   =20
   =20
 =20
  <div>
    <div>
      <p style=3D"margin-bottom:19.2px;margin-top:0px">On 7/13/26 6:15
        AM, David Scherfgen via Maxima-discuss wrote:<br>
      </p>
      <blockquote type=3D"cite" style=3D"border-bottom-color:rgb(119,119,11=
9);border-left:2px solid rgb(114,159,207);border-right-color:rgb(119,119,11=
9);border-top-color:rgb(119,119,119);color:rgb(119,119,119);column-rule-col=
or:rgb(119,119,119);margin:19.2px 0px;outline-color:rgb(119,119,119);paddin=
g-left:16px;padding-right:16px;quotes:none;text-decoration-color:rgb(119,11=
9,119);text-emphasis-color:rgb(119,119,119)">
        <div dir=3D"auto">Dear all,
          <div dir=3D"auto"><br>
          </div>
          <div dir=3D"auto">I noticed that solve doesn&#39;t seem to use th=
e
            facts database to filter solutions.</div>
          <div dir=3D"auto"><br>
          </div>
          <div dir=3D"auto">For example:</div>
          <div dir=3D"auto"><br>
          </div>
          <div dir=3D"auto">(%i1) assume(x &gt; 0)$</div>
          <div dir=3D"auto">(%i2) solve(x^2 =3D 4);</div>
          <div dir=3D"auto">(%o2) [x =3D -2, x =3D 2]</div>
          <div dir=3D"auto"><br>
          </div>
          <div dir=3D"auto">Should this be considered a bug?</div>
        </div>
      </blockquote>
      I thought it was documented that solve doesn=E2=80=99t use the databa=
se,
      but I can=E2=80=99t find any such statement. Maybe that=E2=80=99s jus=
t the general
      understanding of what solve does?
      <blockquote type=3D"cite" style=3D"border-bottom-color:rgb(119,119,11=
9);border-left:2px solid rgb(114,159,207);border-right-color:rgb(119,119,11=
9);border-top-color:rgb(119,119,119);color:rgb(119,119,119);column-rule-col=
or:rgb(119,119,119);margin:19.2px 0px;outline-color:rgb(119,119,119);paddin=
g-left:16px;padding-right:16px;quotes:none;text-decoration-color:rgb(119,11=
9,119);text-emphasis-color:rgb(119,119,119)">
        <div dir=3D"auto">
          <div dir=3D"auto"><br>
          </div>
          <div dir=3D"auto">Should solve be modified so that it rejects
            all solutions that contradict the facts database?</div>
          <div dir=3D"auto">Maybe make it optional to not break existing
            code?</div>
        </div>
      </blockquote>
      Probably make it optional? Maybe be adding a new function to apply
      the database to the results returned from solve?
    </div>
    <div style=3D"height:0;width:0;max-height:0;max-width:0;overflow:hidden=
;font-size:0;padding:0;margin:0" aria-hidden=3D"true" title=3D"MDH:PGJyPjxi=
cj48ZGl2IGNsYXNzPSJtb3otY2l0ZS1wcmVmaXgiPk9uIDcvMTMvMjYgNjoxNSBBTSwgRGF2aWQ=
gU2NoZXJmZ2VuIHZpYSBNYXhpbWEtZGlzY3VzcyB3cm90ZTo8YnI+PC9kaXY+PGJsb2NrcXVvdG=
UgdHlwZT0iY2l0ZSIgY2l0ZT0ibWlkOkNBTVRITEtnbW44SnFHdGNDeVVUeVpNb2d4X1FobX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taWQ6Q0FNVEhMS2dtbjhKcUd0Y0N5VVR5Wk1=
vZ3hfUWhtdG9RMTZjcWg9aW82RXNnN3B2Q3lnQG1haWwuZ21haWwuY29tIj48ZGl2IGRpcj0iYX=
V0byI+PGRpdiBkaXI9ImF1dG8iPjxicj48L2Rpdj48ZGl2IGRpcj0iYXV0byI+U2hvdWxkIHNvb=
HZlIGJlIG1vZGlmaWVkIHNvIHRoYXQgaXQgcmVqZWN0cyBhbGwgc29sdXRpb25zIHRoYXQgY29u=
dHJhZGljdCB0aGUgZmFjdHMgZGF0YWJhc2U/PC9kaXY+PGRpdiBkaXI9ImF1dG8iPk1heWJlIG1=
ha2UgaXQgb3B0aW9uYWwgdG8gbm90IGJyZWFrIGV4aXN0aW5nIGNvZGU/PC9kaXY+PC9kaXY+PC=
9ibG9ja3F1b3RlPlByb2JhYmx5IG1ha2UgaXQgb3B0aW9uYWw/Jm5ic3A7IE1heWJlIGJlIGFkZ=
GluZyBhIG5ldyBmdW5jdGlvbiB0byBhcHBseSB0aGUgZGF0YWJhc2UgdG8gdGhlIHJlc3VsdHMg=
cmV0dXJuZWQgZnJvbSBzb2x2ZT88dWwgY2xhc3M9ImRyb3Bkb3duLW1lbnUgdGV4dGNvbXBsZXR=
lLWRyb3Bkb3duIiBzdHlsZT0iZGlzcGxheTogbm9uZTsgcG9zaXRpb246IGFic29sdXRlOyB6LW=
luZGV4OiAxMDAwOyIgY29udGVudGVkaXRhYmxlPSJmYWxzZSIgcG9wb3Zlcj0iYXV0byI+PC91b=
D4=3D">&amp;#8203;</div>
  </div>

_______________________________________________<br>
Maxima-discuss mailing list<br>
<a href=3D"mailto:[email protected]" rel=3D"noreferrer n=
oreferrer" target=3D"_blank">[email protected]</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/maxima-discuss" rel=
=3D"noreferrer noreferrer noreferrer" target=3D"_blank">https://lists.sourc=
eforge.net/lists/listinfo/maxima-discuss</a><br>
</blockquote></div>

--000000000000e3bf50065688ae91--


--===============2495324845191444374==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============2495324845191444374==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Maxima-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maxima-discuss

--===============2495324845191444374==--