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

PolyOverZ::from_str accepts anything after the last coefficient is entered #292

Open
Marvin-Beckmann opened this issue May 31, 2023 · 2 comments
Labels
bug🐛 Something isn't working

Comments

@Marvin-Beckmann
Copy link
Member

          Why does this work?

Why is it possible to init a PolyOverZ with a string that contains mod?

Originally posted by @MoogSven in #255 (comment)

@Marvin-Beckmann
Copy link
Member Author

Here are some tests with which the problem can be reproduced

    /// Ensure that anything entered after the last coefficient results in an error
    #[test]
    fn information_beyond_last_coeff() {
        assert!(PolyOverZ::from_str("2  24 1 15").is_err());
        assert!(PolyOverZ::from_str("2  24 1 mod 15").is_err());
        assert!(PolyOverZ::from_str("2  24 1 something else").is_err());
    }

The Main Issue

Everything after the last coefficient is simply ignored by FLINT. The question is: Go for efficiency -> not check beforehand or go the safe round and preprocess the string?

@Marvin-Beckmann Marvin-Beckmann added the bug🐛 Something isn't working label May 31, 2023
@Marvin-Beckmann
Copy link
Member Author

As of right now we have decided to leave it as it is for the sake of efficiency as this would require a post or preprocessing of every string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant