-
Notifications
You must be signed in to change notification settings - Fork 0
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
FixedShapedSolver #29
Conversation
…h_with_hole`, and `_rulenode_match` with `pattern_match`
… the `FixedShapedSolver`
…raint, StateInt}` datastructure to check for constraint activation
…vation. From now on, constraints are repropagated by default. Satisfied constraints are responsible for calling `deactivate`.
When runnning the tests, I get
|
We agreed to merge for now, as everything seems to work fine and tests are very thorough. I'll try to do a more in-depth review of the 4500 added lines during the Hackathon. |
@@ -38,7 +38,7 @@ end | |||
``` | |||
""" | |||
macro csgrammar_annotated(expression) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is still necessary?
Contains <: GrammarConstraint | ||
This [`GrammarConstraint`] enforces that a given `rule` appears in the program tree at least once. | ||
""" | ||
struct Contains <: GrammarConstraint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Contains
is a verb and should hence not be used as a struct name; also not very descriptive. Better use ContainsConstraint
Therefore, [`Forbidden`](@ref) can only be used in implementations that keep track of the | ||
[`LocalConstraint`](@ref)s and propagate them at the right moments. | ||
""" | ||
struct Forbidden <: GrammarConstraint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name is a Verb, hence sub-optimal for struct name. Better use ForbiddenConstraint
Adds two types of solvers:
FixedShapedSolver
. This solver is more memory efficient, but only works on fixed shaped trees. It enumerates all solutions of a fixed shaped tree by (re)assigning the values of holes. To achieve this, it uses a new fixed shaped hole type with stateful domains.GenericSolver
. This solver has more flexible state management. It treats each state as an independent propagation program. Iterators can usesave_state!
andload_state!
to switch between states at any time.