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

Support building infix logic representation #1530

Merged
merged 34 commits into from
Jan 7, 2025

Conversation

esseivaju
Copy link
Contributor

@esseivaju esseivaju commented Dec 2, 2024

Refactor the PostfixLogicBuilder to support other types of logic notations. In particular, support for infix notation as part of #1282. PostfixLogicBuilder is now a free function called build_logic that is templated on a policy object dictating the notation to build. Any state is now held in the policy object instead of the builder object and build_logic provides common behavior (faces mapping).

This simple implementation inserts parentheses around every single Joined operator even if they wouldn't be necessary. This also doesn't check that the tree is in a valid infix-compatible form (no Negated {Joined{}} node)

@esseivaju esseivaju added enhancement New feature or request orange Work on ORANGE geometry engine labels Dec 2, 2024
Copy link

github-actions bot commented Dec 3, 2024

Test summary

 4 215 files   6 481 suites   15m 4s ⏱️
 1 670 tests  1 664 ✅  6 💤 0 ❌
22 862 runs  22 782 ✅ 80 💤 0 ❌

Results for commit 5c0b09c.

♻️ This comment has been updated with latest results.

@esseivaju esseivaju changed the title Add InfixLogicBuilder Support for building infix logic representation Dec 9, 2024
Copy link
Contributor Author

@esseivaju esseivaju left a comment

Choose a reason for hiding this comment

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

@sethrj I think this is ready now.

src/orange/orangeinp/detail/LogicBuilderPolicies.hh Outdated Show resolved Hide resolved
@esseivaju esseivaju changed the title Support for building infix logic representation Support building infix logic representation Dec 10, 2024
Copy link
Member

@sethrj sethrj left a comment

Choose a reason for hiding this comment

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

Sorry I've had these queued up for a couple days but forgot to send

src/orange/orangeinp/UnitProto.cc Outdated Show resolved Hide resolved
src/orange/orangeinp/detail/LogicBuilderPolicies.hh Outdated Show resolved Hide resolved
src/orange/orangeinp/detail/LogicBuilderPolicies.hh Outdated Show resolved Hide resolved
test/orange/orangeinp/CsgTreeUtils.test.cc Outdated Show resolved Hide resolved
src/orange/orangeinp/detail/LogicBuilder.cc Outdated Show resolved Hide resolved
@esseivaju
Copy link
Contributor Author

@sethrj @elliottbiondo Ready for a 2nd look.

Copy link
Member

@sethrj sethrj left a comment

Choose a reason for hiding this comment

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

I think this is good enough, we have enough to do besides going in circles about the details of the details of the details here. Thanks!

@sethrj sethrj merged commit f2369f0 into celeritas-project:develop Jan 7, 2025
37 checks passed
@esseivaju esseivaju deleted the infix-logic-builder branch January 7, 2025 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request orange Work on ORANGE geometry engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants