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

Translation from Conjure-Oxide Model to Minion Model for XYZ Problem #75

Merged
merged 8 commits into from
Nov 20, 2023

Conversation

niklasdewally
Copy link
Contributor

@niklasdewally niklasdewally commented Nov 15, 2023

As per #68

@niklasdewally
Copy link
Contributor Author

niklasdewally commented Nov 16, 2023

@lixitrixi @ozgurakgun What are your thoughts on #[non_exhaustive] on public AST things?
I have started putting some in in here - I think it might be good for backwards compatibility as we add constraints.

https://doc.rust-lang.org/reference/attributes/type_system.html#the-non_exhaustive-attribute

For our purposes, it would effectively always force a _ => Err() branch on any pattern matching involving the ast.

@ozgurakgun
Copy link
Contributor

as far as I understand this forces users to always handle the _ case, is that right?

it could be good for documenting intent, but on the other hand I think we want compiler warnings/errors when we add new cases instead of silently compiling without warnings. code that only cares abotu some of the cases can still use _, but code that is intented to be exhaustive will get a compile time warning/error instead. does that make sense?

@ChrisJefferson
Copy link
Contributor

Note you can use:

        #[allow(unreachable_patterns)]
        _ => panic!(""),

Where you don't want to worry about future cases (and that could be added in commits which add a new thing we temporarily dont want to worry about)

@niklasdewally
Copy link
Contributor Author

niklasdewally commented Nov 16, 2023 via email

@niklasdewally
Copy link
Contributor Author

@ozgurakgun I have translation working for XYZ from the flat conjure to minion.

Could do with more testing, but I am relying on private methods and manual construction of all the AST stuff ( i think ::new(), etc are in #32 ?), so these will need to be rewritten anyways.

Copy link
Contributor

@ozgurakgun ozgurakgun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comments, looks good to me!

conjure_oxide/src/solvers/minion.rs Outdated Show resolved Hide resolved
conjure_oxide/src/solvers/minion.rs Outdated Show resolved Hide resolved
@niklasdewally
Copy link
Contributor Author

@ozgurakgun I can confirm that I can no longer merge PRs to main :)

@ozgurakgun ozgurakgun merged commit 406951a into conjure-cp:main Nov 20, 2023
17 checks passed
@niklasdewally niklasdewally deleted the issue/68 branch November 20, 2023 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Translating a Conjure-Oxide model to Minion (for XYZ problem)
3 participants