-
Notifications
You must be signed in to change notification settings - Fork 19
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
Make Reduction new_top, and Model constraints a vector #421
Comments
I am not sure if it uses less space etc. For me the major benefit is being close to the input model, which in turn means if we pretty print the model it would look closer to what the user wrote. For reference, this is how model is defined in Conjure: https://github.com/conjure-cp/conjure/blob/4bae499bcc7ec93a69ea0f2ea46078544ddb097c/src/Conjure/Language/Definition.hs#L76 Also see Statement and Expression in that file. I think we should reproduce this, in addition we will keep context (including symbol table) as well. |
In PR #421, tests were unintentionally passing due to expected files being overwritten regardless of whether the generated solutions matched Conjure’s solutions. This commit refactors the integration_test_inner function and related file I/O utilities so that: - When ACCEPT=false, tests still compare generated outputs (parse, rewrite, solutions, and traces) against the expected results as before. - When ACCEPT=true, tests now first verify that the generated solutions match the Conjure solutions. Only if they match are the expected files updated. If they don’t match, the test fails without updating the expected files.
In PR #421, tests were unintentionally passing due to expected files being overwritten regardless of whether the generated solutions matched Conjure’s solutions. This commit refactors the integration_test_inner function and related file I/O utilities so that: - When ACCEPT=false, tests still compare generated outputs (parse, rewrite, solutions, and traces) against the expected results as before. - When ACCEPT=true, tests now first verify that the generated solutions match the Conjure solutions. Only if they match are the expected files updated. If they don’t match, the test fails without updating the expected files.
In PR #421, tests were unintentionally passing due to expected files being overwritten regardless of whether the generated solutions matched Conjure’s solutions. This commit refactors the integration_test_inner function and related file I/O utilities so that: * When ACCEPT=false, tests still compare generated outputs (parse, rewrite, solutions, and traces) against the expected results as before. * When ACCEPT=true, tests now first verify that the generated solutions match the Conjure solutions. Only if they match are the expected files updated. If they don’t match, the test fails without updating the expected files.
In PR #421, tests were unintentionally passing due to expected files being overwritten regardless of whether the generated solutions matched Conjure’s solutions. This commit refactors the integration_test_inner function and related file I/O utilities so that: * When ACCEPT=false, tests still compare generated outputs (parse, rewrite, solutions, and traces) against the expected results as before. * When ACCEPT=true, tests now first verify that the generated solutions match the Conjure solutions. Only if they match are the expected files updated. If they don’t match, the test fails without updating the expected files. Stages desciption: 1a: Parse (Convert the Essence model into an internal format.) 1b: Check against other parser(s) (Compare output from different parsing methods (e.g., native parser vs JSON parser).) 2a: Rewrite (Apply transformations to the parsed model (e.g., simplifying expressions, normalizing).) 2b: Check model properties (extra_asserts) (Verify additional model properties (e.g., ensure vector operators are evaluated).) 3a: Solve (Run the model through the solver to find solutions.) 3b: Check solutions against Conjure (Compare solutions with expected output from the Conjure solver.) 4a: Check that the generated rules match expected traces
In PR #421, tests were unintentionally passing due to expected files being overwritten regardless of whether the generated solutions matched Conjure’s solutions. This commit refactors the integration_test_inner function and related file I/O utilities so that: * When ACCEPT=false, tests still compare generated outputs (parse, rewrite, solutions, and traces) against the expected results as before. * When ACCEPT=true, tests now first verify that the generated solutions match the Conjure solutions. Only if they match are the expected files updated. If they don’t match, the test fails without updating the expected files. Stages desciption: 1a: Parse (Convert the Essence model into an internal format.) 1b: Check against other parser(s) (Compare output from different parsing methods (e.g., native parser vs JSON parser).) 2a: Rewrite (Apply transformations to the parsed model (e.g., simplifying expressions, normalizing).) 2b: Check model properties (extra_asserts) (Verify additional model properties (e.g., ensure vector operators are evaluated).) 3a: Solve (Run the model through the solver to find solutions.) 3b: Check solutions against Conjure (Compare solutions with expected output from the Conjure solver.) 4a: Check that the generated rules match expected traces
In PR #421, tests were unintentionally passing due to expected files being overwritten regardless of whether the generated solutions matched Conjure’s solutions. This commit refactors the integration_test_inner function and related file I/O utilities so that: * When ACCEPT=false, tests still compare generated outputs (parse, rewrite, solutions, and traces) against the expected results as before. * When ACCEPT=true, tests now first verify that the generated solutions match the Conjure solutions. Only if they match are the expected files updated. If they don’t match, the test fails without updating the expected files. Stages desciption: 1a: Parse (Convert the Essence model into an internal format.) 1b: Check against other parser(s) (Compare output from different parsing methods (e.g., native parser vs JSON parser).) 2a: Rewrite (Apply transformations to the parsed model (e.g., simplifying expressions, normalizing).) 2b: Check model properties (extra_asserts) (Verify additional model properties (e.g., ensure vector operators are evaluated).) 3a: Solve (Run the model through the solver to find solutions.) 3b: Check solutions against Conjure (Compare solutions with expected output from the Conjure solver.) 4a: Check that the generated rules match expected traces
We would like to make new_top an attribute in Reduction and constraints in Model a vector. I attempted to implement this in PR #370 but was unsuccessful.
@ozgurakgun, could you clarify the benefits of using vectors for these attributes? I understand that it looks cleaner and might use less space, as an empty vector is smaller than Expression::And(Metadata::new(), Vec::new()). However, are there other reasons I should consider while implementing this change?
The text was updated successfully, but these errors were encountered: