Herb-AI / HerbConstraints.jl

Constraints for Herb.jl

Home Page:https://herb-ai.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a path datastructure to constraints

jaapdejong15 opened this issue · comments

There should also be a path datastructure in the constraints, accompanying the tree datastructure.
It should define a constraint on the path from the root to the current hole.

Furthermore, it should also support variables, e.g. 1-x-2, meaning that there is a variable number of nodes allowed between rulenode 1 and 2. This can be used to e.g. define the ComesAfter constraint.

Nice-to-haves:

  • Define a syntax with which users can easily provide these paths
  • Support for defining options, e.g. [1,2] matches either rulenode 1 or 2
  • Support for various regex-like symbols, such as
    • + for matching 1 or more
    • ? for matching 0 or 1
    • * for matching 0 or more
    • . for matching every rule
    • r{n} for matching rule r exactly n times. This could also be desugared.