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.
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:
[1,2]
matches either rulenode 1 or 2+
for matching 1 or more?
for matching 0 or 1*
for matching 0 or more.
for matching every ruler{n}
for matching ruler
exactlyn
times. This could also be desugared.