Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect variable output QEPCAD #38310

Open
2 tasks done
anirjoshi opened this issue Jun 29, 2024 · 3 comments
Open
2 tasks done

Incorrect variable output QEPCAD #38310

anirjoshi opened this issue Jun 29, 2024 · 3 comments
Labels

Comments

@anirjoshi
Copy link

anirjoshi commented Jun 29, 2024

Steps To Reproduce

  1. In the Sagecell server here, the output has variables x50 and x51 that do not exist in the input at all.

Expected Behavior

The output should have variables that exist in the input.

Actual Behavior

The output has variables x50 and x51 that do not exist in the input.

Additional Information

This is in reference to a previous github issue here

Environment

- **OS**: SageMathCell
- **Sage Version**: SageMathCell

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide
@maxale
Copy link
Contributor

maxale commented Jun 29, 2024

Can it be the case that QEPCAD introduces these new variables itself?

Also, unless Sage somehow miscommunicates with QEPCAD, any issues related to what QEPCAD computes should be reported to its authors, not Sage.

@DaveWitteMorris
Copy link
Member

It seems pretty clear that the problem is that the underscores get deleted from variable names. Here is a simpler example:

sage: var('x')
sage: var('name_with_underscores');
sage: print(qepcad(qepcad_formula.exists(x, name_with_underscores * x^2 < 0)))
namewithunderscores < 0

So a workaround would be to avoid using underscores in variable names.

If we are not going to fix this, then I think an acceptable stopgap would be to check for underscores in the variable names, and raise NotImplementedError. But it would certainly be better if someone is willing to fix the actual problem.

@DaveWitteMorris
Copy link
Member

Lines 1565-1569 of interfaces/qepcad.py:

    We verify that long variable names work.  (Note that QEPCAD
    does not support underscores, so they are stripped from the formula.) ::

        sage: qepcad(qf.exists(a, a*long_with_underscore_314159 == 1))                # optional - qepcad
        longwithunderscore314159 /= 0

So supporting underscores would require a nontrivial change to the interface.

For now, I would suggest raising NotImplementedError and documenting the need to avoid underscores. However, there could be a keyword argument to choose the current implementation, which strips the underscores. That would make it easy to have a deprecation period, which might be a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants