HerbConstraints.jl Documentation
HerbConstraints.AbstractMatchNode
— Typeabstract type AbstractMatchNode
Tree structure to which rulenode trees can be matched. Consists of MatchNodes, which can match a specific RuleNode, and MatchVars, which is a variable that can be filled in with any RuleNode.
HerbConstraints.ComesAfter
— TypeComesAfter <: PropagatorConstraint
A ComesAfter
constraint is a PropagatorConstraint
containing the following:
rule::Int
: A reference to a rule in the grammarpredecessors
: A list of rules in the grammar
This Constraint
enforces that the rule
can only be applied if every rule in predecessors
is used in the path from the root of the tree to the current hole in the order that they are given. Even though the rules must be in order, there might be other rules inbetween.
For example, consider the tree 1(a, 2(b, 3(c, d))))
:
ComesAfter(4, [2, 3])
would enforce that rule4
can only be used if2
and3
are used in the path from the root in that order. Therefore, only holec
andd
can be filled with4
.ComesAfter(4, [1, 3])
also allowsc
andd
to be filled, since1
and3
are still used in the correct order. It does not matter that2
is also used in the path to the root.ComesAfter(4, [3, 2])
does not allow any hole to be filled with4
, since either the predecessors are either not in the path or in the wrong order for each of the holes.
HerbConstraints.ComesAfter
— MethodComesAfter(rule::Int, predecessor::Int)
Creates a ComesAfter
constraint with only a single predecessor
.
HerbConstraints.Forbidden
— TypeForbidden <: PropagatorConstraint
This [PropagatorConstraint
] forbids any subtree that matches the pattern given by tree
to be generated. A pattern is a tree of AbstractMatchNode
s. Such a node can either be a MatchNode
, which contains a rule index corresponding to the rule index in the Grammar
and the appropriate number of children, similar to RuleNode
s. It can also contain a MatchVar
, which contains a single identifier symbol. A MatchVar
can match any subtree, but if there are multiple instances of the same variable in the pattern, the matched subtrees must be identical. Any rule in the domain that makes the match attempt successful is removed.
For example, consider the tree 1(a, 2(b, 3(c, 4))))
:
Forbidden(MatchNode(3, [MatchNode(5), MatchNode(4)]))
forbidsc
to be filled with5
.Forbidden(MatchNode(3, [MatchVar(:v), MatchNode(4)]))
forbidsc
to be filled, since a [MatchVar
] can match any rule, thus making the match attempt successful for the entire domain ofc
. Therefore, this tree invalid.Forbidden(MatchNode(3, [MatchVar(:v), MatchVar(:v)]))
forbidsc
to be filled with4
, since that would make both assignments tov
equal, which causes a successful match.
The Forbidden
constraint makes use of LocalConstraint
s to make sure that constraints are also enforced in the future when the context of a Hole
changes. Therefore, Forbidden
can only be used in implementations that keep track of the LocalConstraint
s and propagate them at the right moments.
HerbConstraints.ForbiddenPath
— TypeForbiddenPath <: PropagatorConstraint
A [PropagatorConstraint
] that forbids a certain derivation sequence. sequence
defines the forbidden sequence. Each rule that would complete the sequence when expanding a Hole
in an AbstractRuleNode
tree is removed from the domain. The derivation sequence is the path from the root to the hole.
For example, consider the tree 1(a, 2(b, 3(c, d))))
:
ForbiddenPath([1, 2, 4])
enforces that rule4
cannot be applied atb
, since it completes the sequence. However, it can be applied ata
,c
andd
.ForbiddenPath([3, 1])
enforces that rule1
cannot be applied atc
ord
.
HerbConstraints.GrammarContext
— Typemutable struct GrammarContext
Structure used to track the context. Contains: - the expression being modified - the path to the hole that is being expanded, represented as a sequence of child indices. e.g., [2, 1] would point to the first child of the second child of the root. - a vector with local constraints that should be propagated upon expansion.
HerbConstraints.LocalConstraint
— Typeabstract type LocalConstraint <: Constraint
Abstract type representing all local constraints. Local constraints correspond to a specific (partial) AbstractRuleNode
tree. Each local constraint contains a path
to a specific location in the tree. Each local constraint has an implementation of a propagate
-function that takes
- the
LocalConstraint
- a
Grammar
- a
GrammarContext
, which most importantly contains the tree and the location in the tree where propagation should take place. - The
domain
which thepropagate
-function prunes.
The propagate
-function returns a tuple containing
- The pruned
domain
- A list of new
LocalConstraint
s
By default, LocalConstraint
s are only propagated once. Constraints that have to be propagated more frequently should return themselves in the list of new local constraints.
HerbConstraints.LocalForbidden
— TypeLocalForbidden
Forbids the a subtree that matches the MatchNode tree to be generated at the location provided by the path. Use a Forbidden
constraint for enforcing this throughout the entire search space.
HerbConstraints.LocalOneOf
— TypeMeta-constraint that enforces the disjunction of its given constraints.
HerbConstraints.LocalOrdered
— TypeEnforces an order over two or more subtrees that fill the variables specified in order
when the pattern is applied at the location given by path
. Use an Ordered
constraint for enforcing this throughout the entire search space.
HerbConstraints.MatchFail
— Type@enum MatchFail hardfail softfail
This enum is used for distinguishing between two types of failures when trying to match a RuleNode
either with another RuleNode
or with an AbstractMatchNode
- Hardfail means that there is no match, and there is no way to fill in the holes to get a match.
- Softfail means that there is no match, but there might be a way to fill the holes that results in a match.
HerbConstraints.MatchNode
— Typestruct MatchNode <: AbstractMatchNode
Match a specific rulenode, where the grammar rule index is rule_ind
and children
matches the children of the RuleNode. Example usage:
MatchNode(3, [MatchNode(1), MatchNode(2)])
This matches RuleNode(3, [RuleNode(1), RuleNode(2)])
HerbConstraints.MatchVar
— Typestruct MatchVar <: AbstractMatchNode
Matches anything and assigns it to a variable. The ForbiddenTree
constraint will not match if identical variable symbols match to different trees. Example usage:
MatchNode(3, [MatchVar(:x), MatchVar(:x)])
This matches RuleNode(3, [RuleNode(1), RuleNode(1)])
, RuleNode(3, [RuleNode(2), RuleNode(2)])
, etc.
HerbConstraints.OneOf
— TypeMeta-constraint that enforces the disjunction of its given constraints.
HerbConstraints.Ordered
— TypeOrdered <: PropagatorConstraint
A PropagatorConstraint
that enforces a specific order in MatchVar
assignments in the pattern defined by tree
. A pattern is a tree of AbstractMatchNode
s. Such a node can either be a MatchNode
, which contains a rule index corresponding to the rule index in the Grammar
and the appropriate number of children, similar to RuleNode
s. It can also contain a MatchVar
, which contains a single identifier symbol. A MatchVar
can match any subtree, but if there are multiple instances of the same variable in the pattern, the matched subtrees must be identical.
The order
defines an order between the variable assignments. For example, if the order is [x, y]
, the constraint will require the assignment to x
to be less than or equal to the assignment to y
. The order is recursively defined by RuleNode
indices. For more information, see Base.isless(rn₁::AbstractRuleNode, rn₂::AbstractRuleNode)
.
For example, consider the tree 1(a, 2(b, 3(c, 4))))
:
Ordered(MatchNode(3, [MatchVar(:v), MatchVar(:w)]), [:v, :w])
removes every rule with an index of 5 or greater from the domain ofc
, since that would make the index of the assignment tov
greater than the index of the assignment tow
, violating the order.Ordered(MatchNode(3, [MatchVar(:v), MatchVar(:w)]), [:w, :v])
removes every rule with an index of 4 or less from the domain ofc
, since that would make the index of the assignment tov
less than the index of the assignment tow
, violating the order.
The Ordered
constraint makes use of LocalConstraint
s to make sure that constraints are also enforced in the future when the context of a Hole
changes. Therefore, Ordered
can only be used in implementations that keep track of the LocalConstraint
s and propagate them at the right moments.
HerbConstraints.PropagatorConstraint
— TypePropagatorConstraint <: Constraint
Abstract type representing all propagator constraints. Each propagator constraint has an implementation of a propagate
-function that takes
- the
PropagatorConstraint
- a
Grammar
- a
GrammarContext
, which most importantly contains the tree and the location in the tree where propagation should take place. - The
domain
which thepropagate
-function prunes.
The propagate
-function returns a tuple containing
- The pruned
domain
- A list of new
LocalConstraint
s
HerbConstraints.RequireOnLeft
— TypeRules have to be used in the specified order. That is, rule at index K can only be used if rules at indices [1...K-1] are used in the left subtree of the current expression
HerbConstraints.@csgrammar_annotated
— Macro@csgrammar_annotated Define an annotated grammar and return it as a ContextSensitiveGrammar. Allows for adding optional annotations per rule. As well as that, allows for adding optional labels per rule, which can be referenced in annotations. Syntax is backwards-compatible with @csgrammar. Examples:
g₁ = @csgrammar_annotated begin
+HerbConstraints.jl · Herb.jl HerbConstraints.jl Documentation
HerbConstraints.AbstractMatchNode
— Typeabstract type AbstractMatchNode
Tree structure to which rulenode trees can be matched. Consists of MatchNodes, which can match a specific RuleNode, and MatchVars, which is a variable that can be filled in with any RuleNode.
sourceHerbConstraints.ComesAfter
— TypeComesAfter <: PropagatorConstraint
A ComesAfter
constraint is a PropagatorConstraint
containing the following:
rule::Int
: A reference to a rule in the grammarpredecessors
: A list of rules in the grammar
This Constraint
enforces that the rule
can only be applied if every rule in predecessors
is used in the path from the root of the tree to the current hole in the order that they are given. Even though the rules must be in order, there might be other rules inbetween.
For example, consider the tree 1(a, 2(b, 3(c, d))))
:
ComesAfter(4, [2, 3])
would enforce that rule 4
can only be used if 2
and 3
are used in the path from the root in that order. Therefore, only hole c
and d
can be filled with 4
.ComesAfter(4, [1, 3])
also allows c
and d
to be filled, since 1
and 3
are still used in the correct order. It does not matter that 2
is also used in the path to the root.ComesAfter(4, [3, 2])
does not allow any hole to be filled with 4
, since either the predecessors are either not in the path or in the wrong order for each of the holes.
sourceHerbConstraints.ComesAfter
— MethodComesAfter(rule::Int, predecessor::Int)
Creates a ComesAfter
constraint with only a single predecessor
.
sourceHerbConstraints.Forbidden
— TypeForbidden <: PropagatorConstraint
This [PropagatorConstraint
] forbids any subtree that matches the pattern given by tree
to be generated. A pattern is a tree of AbstractMatchNode
s. Such a node can either be a MatchNode
, which contains a rule index corresponding to the rule index in the Grammar
and the appropriate number of children, similar to RuleNode
s. It can also contain a MatchVar
, which contains a single identifier symbol. A MatchVar
can match any subtree, but if there are multiple instances of the same variable in the pattern, the matched subtrees must be identical. Any rule in the domain that makes the match attempt successful is removed.
For example, consider the tree 1(a, 2(b, 3(c, 4))))
:
Forbidden(MatchNode(3, [MatchNode(5), MatchNode(4)]))
forbids c
to be filled with 5
.Forbidden(MatchNode(3, [MatchVar(:v), MatchNode(4)]))
forbids c
to be filled, since a [MatchVar
] can match any rule, thus making the match attempt successful for the entire domain of c
. Therefore, this tree invalid.Forbidden(MatchNode(3, [MatchVar(:v), MatchVar(:v)]))
forbids c
to be filled with 4
, since that would make both assignments to v
equal, which causes a successful match.
Warning The Forbidden
constraint makes use of LocalConstraint
s to make sure that constraints are also enforced in the future when the context of a Hole
changes. Therefore, Forbidden
can only be used in implementations that keep track of the LocalConstraint
s and propagate them at the right moments.
sourceHerbConstraints.ForbiddenPath
— TypeForbiddenPath <: PropagatorConstraint
A [PropagatorConstraint
] that forbids a certain derivation sequence. sequence
defines the forbidden sequence. Each rule that would complete the sequence when expanding a Hole
in an AbstractRuleNode
tree is removed from the domain. The derivation sequence is the path from the root to the hole.
For example, consider the tree 1(a, 2(b, 3(c, d))))
:
ForbiddenPath([1, 2, 4])
enforces that rule 4
cannot be applied at b
, since it completes the sequence. However, it can be applied at a
, c
and d
.ForbiddenPath([3, 1])
enforces that rule 1
cannot be applied at c
or d
.
sourceHerbConstraints.GrammarContext
— Typemutable struct GrammarContext
Structure used to track the context. Contains: - the expression being modified - the path to the hole that is being expanded, represented as a sequence of child indices. e.g., [2, 1] would point to the first child of the second child of the root. - a vector with local constraints that should be propagated upon expansion.
sourceHerbConstraints.LocalConstraint
— Typeabstract type LocalConstraint <: Constraint
Abstract type representing all local constraints. Local constraints correspond to a specific (partial) AbstractRuleNode
tree. Each local constraint contains a path
to a specific location in the tree. Each local constraint has an implementation of a propagate
-function that takes
- the
LocalConstraint
- a
Grammar
- a
GrammarContext
, which most importantly contains the tree and the location in the tree where propagation should take place. - The
domain
which the propagate
-function prunes.
The propagate
-function returns a tuple containing
- The pruned
domain
- A list of new
LocalConstraint
s
Warning By default, LocalConstraint
s are only propagated once. Constraints that have to be propagated more frequently should return themselves in the list of new local constraints.
sourceHerbConstraints.LocalForbidden
— TypeLocalForbidden
Forbids the a subtree that matches the MatchNode tree to be generated at the location provided by the path. Use a Forbidden
constraint for enforcing this throughout the entire search space.
sourceHerbConstraints.LocalOneOf
— TypeMeta-constraint that enforces the disjunction of its given constraints.
sourceHerbConstraints.LocalOrdered
— TypeEnforces an order over two or more subtrees that fill the variables specified in order
when the pattern is applied at the location given by path
. Use an Ordered
constraint for enforcing this throughout the entire search space.
sourceHerbConstraints.MatchFail
— Type@enum MatchFail hardfail softfail
This enum is used for distinguishing between two types of failures when trying to match a RuleNode
either with another RuleNode
or with an AbstractMatchNode
- Hardfail means that there is no match, and there is no way to fill in the holes to get a match.
- Softfail means that there is no match, but there might be a way to fill the holes that results in a match.
sourceHerbConstraints.MatchNode
— Typestruct MatchNode <: AbstractMatchNode
Match a specific rulenode, where the grammar rule index is rule_ind
and children
matches the children of the RuleNode. Example usage:
MatchNode(3, [MatchNode(1), MatchNode(2)])
This matches RuleNode(3, [RuleNode(1), RuleNode(2)])
sourceHerbConstraints.MatchVar
— Typestruct MatchVar <: AbstractMatchNode
Matches anything and assigns it to a variable. The ForbiddenTree
constraint will not match if identical variable symbols match to different trees. Example usage:
MatchNode(3, [MatchVar(:x), MatchVar(:x)])
This matches RuleNode(3, [RuleNode(1), RuleNode(1)])
, RuleNode(3, [RuleNode(2), RuleNode(2)])
, etc.
sourceHerbConstraints.OneOf
— TypeMeta-constraint that enforces the disjunction of its given constraints.
sourceHerbConstraints.Ordered
— TypeOrdered <: PropagatorConstraint
A PropagatorConstraint
that enforces a specific order in MatchVar
assignments in the pattern defined by tree
. A pattern is a tree of AbstractMatchNode
s. Such a node can either be a MatchNode
, which contains a rule index corresponding to the rule index in the Grammar
and the appropriate number of children, similar to RuleNode
s. It can also contain a MatchVar
, which contains a single identifier symbol. A MatchVar
can match any subtree, but if there are multiple instances of the same variable in the pattern, the matched subtrees must be identical.
The order
defines an order between the variable assignments. For example, if the order is [x, y]
, the constraint will require the assignment to x
to be less than or equal to the assignment to y
. The order is recursively defined by RuleNode
indices. For more information, see Base.isless(rn₁::AbstractRuleNode, rn₂::AbstractRuleNode)
.
For example, consider the tree 1(a, 2(b, 3(c, 4))))
:
Ordered(MatchNode(3, [MatchVar(:v), MatchVar(:w)]), [:v, :w])
removes every rule with an index of 5 or greater from the domain of c
, since that would make the index of the assignment to v
greater than the index of the assignment to w
, violating the order.Ordered(MatchNode(3, [MatchVar(:v), MatchVar(:w)]), [:w, :v])
removes every rule with an index of 4 or less from the domain of c
, since that would make the index of the assignment to v
less than the index of the assignment to w
, violating the order.
Warning The Ordered
constraint makes use of LocalConstraint
s to make sure that constraints are also enforced in the future when the context of a Hole
changes. Therefore, Ordered
can only be used in implementations that keep track of the LocalConstraint
s and propagate them at the right moments.
sourceHerbConstraints.PropagatorConstraint
— TypePropagatorConstraint <: Constraint
Abstract type representing all propagator constraints. Each propagator constraint has an implementation of a propagate
-function that takes
- the
PropagatorConstraint
- a
Grammar
- a
GrammarContext
, which most importantly contains the tree and the location in the tree where propagation should take place. - The
domain
which the propagate
-function prunes.
The propagate
-function returns a tuple containing
- The pruned
domain
- A list of new
LocalConstraint
s
sourceHerbConstraints.RequireOnLeft
— TypeRules have to be used in the specified order. That is, rule at index K can only be used if rules at indices [1...K-1] are used in the left subtree of the current expression
sourceHerbConstraints.@csgrammar_annotated
— Macro@csgrammar_annotated Define an annotated grammar and return it as a ContextSensitiveGrammar. Allows for adding optional annotations per rule. As well as that, allows for adding optional labels per rule, which can be referenced in annotations. Syntax is backwards-compatible with @csgrammar. Examples:
g₁ = @csgrammar_annotated begin
Element = 1
Element = x
Element = Element + Element := commutative
@@ -18,4 +18,4 @@
forbidden_path([:addition, :one]) || forbidden_path([:one, :variable])
)
multiplication:: Element = Element * Element := (commutative, transitive)
-end
Base.show
— MethodBase.show(io::IO, node::MatchNode; separator=",", last_child::Bool=true)
Prints a found MatchNode
given an and the respective children to IO
.
Base.show
— MethodBase.show(io::IO, node::MatchVar; separator=",", last_child::Bool=true)
Prints a matching variable assignment described by MatchVar
to IO
.
HerbConstraints._matchnode2expr
— Function_matchnode2expr(expr::Expr, pattern::MatchVar, grammar::Grammar, j=0)
Internal function for matchnode2expr
, recursively iterating over a matched variable and converting it to an expression. This is primarily useful for pretty-printing a pattern. Returns the corresponding expression and the current child index.
HerbConstraints._matchnode2expr
— Function_matchnode2expr(typ::Symbol, pattern::MatchNode, grammar::Grammar, j=0)
Internal function for matchnode2expr
, returning the matched translated symbol. This is primarily useful for pretty-printing a pattern. Returns the corresponding expression, i.e. the variable name and the current child index.
HerbConstraints._matchnode2expr
— Function_matchnode2expr(typ::Symbol, pattern::MatchVar, grammar::Grammar, j=0)
Internal function for matchnode2expr
. This is primarily useful for pretty-printing a pattern. Returns the corresponding expression, i.e. the variable name and the current child index.
HerbConstraints._matchnode2expr
— Function_matchnode2expr(expr::Expr, pattern::MatchNode, grammar::Grammar, j=0)
Internal function for matchnode2expr
, recursively iterating over a matched pattern and converting it to an expression. This is primarily useful for pretty-printing a pattern. Returns the corresponding expression and the current child index.
HerbConstraints._pattern_match
— Method_pattern_match(rn::RuleNode, mn::MatchNode, vars::Dict{Symbol, AbstractRuleNode})::Union{Nothing, MatchFail}
Tries to match RuleNode
rn
with MatchNode
mn
. Modifies the variable assignment dictionary vars
. Returns nothing
if the match is successful. If the match is unsuccessful, it returns whether it is a softfail or hardfail (see MatchFail
docstring)
HerbConstraints._pattern_match
— Method_pattern_match(rn::RuleNode, mv::MatchVar, vars::Dict{Symbol, AbstractRuleNode})::Union{Nothing, MatchFail}
Matching RuleNode
rn
with MatchVar
mv
. If the variable is already assigned, the rulenode is matched with the specific variable value. Returns nothing
if the match is succesful. If the match is unsuccessful, it returns whether it is a softfail or hardfail (see MatchFail
docstring)
HerbConstraints._pattern_match_with_hole
— MethodHerbConstraints._pattern_match_with_hole
— Method_pattern_match_with_hole(::Hole, mn::MatchNode, hole_location::Vector{Int}, ::Dict{Symbol, AbstractRuleNode})::Union{Int, Symbol, MatchFail, Tuple{Symbol, Vector{Int}}}
Matches the Hole
with the given MatchVar
, similar to _pattern_match_with_hole
.
HerbConstraints._pattern_match_with_hole
— Method_pattern_match_with_hole(rn::RuleNode, mn::MatchNode, hole_location::Vector{Int}, vars::Dict{Symbol, AbstractRuleNode})::Union{Int, Symbol, MatchFail, Tuple{Symbol, Vector{Int}}}
Tries to match RuleNode
rn
with MatchNode
mn
and fill in the domain of the hole at hole_location
. Returns if match is successful either:
- The id for the node which fills the hole
- A symbol for the variable that fills the hole
- A tuple containing:
- The variable that matched (the subtree containing) the hole
- The location of the hole in this subtree
If the match is unsuccessful, it returns:
- hardfail if there are no holes that can be filled in such a way that the match will become succesful
- softfail if the match could become successful if the holes are filled in a certain way
HerbConstraints._pattern_match_with_hole
— Method_pattern_match_with_hole(rn::RuleNode, mv::MatchVar, hole_location::Vector{Int}, vars::Dict{Symbol, AbstractRuleNode})::Union{Int, Symbol, MatchFail, Tuple{Symbol, Vector{Int}}}
Tries to match RuleNode
rn
with MatchVar
mv
and fill in the domain of the hole at hole_location
. If the variable name is already assigned in vars
, the rulenode is matched with the hole. Otherwise the variable and the hole location are returned.
HerbConstraints._rulenode_compare
— Method- Returns -1 if rn₁ < rn₂
- Returns 0 if rn₁ == rn₂
- Returns 1 if rn₁ > rn₂
HerbConstraints._rulenode_match_with_hole
— Method_rulenode_match_with_hole(rn₁::RuleNode, rn₂::RuleNode, hole_location::Vector{Int})::Union{Int, MatchFail}
Matches two rulenodes. Returns how to fill in the hole in rn₁ to make it match rn₂ if:
- rn₁ has a single hole at the provided location
- rn₂ doesn't have any holes
- rn₁ matches rn₂ apart from the single hole location.
If the match fails, it returns whether it is a softfail or a hardfail (see MatchFail docstring)
HerbConstraints.addparent!
— Methodaddparent!(context::GrammarContext, parent::Int)
Adds a parent to the context. The parent is defined by the grammar rule id.
HerbConstraints.annotation2constraint
— MethodConverts an annotation to a constraint. commutative: creates an Ordered constraint transitive: creates an (incorrect) Forbidden constraint forbidden_path(path::Vector{Union{Symbol, Int}}): creates a ForbiddenPath constraint with the original rule included ... || ...: creates a OneOf constraint (also works with ... || ... || ... et cetera, though not very performant)
HerbConstraints.check_tree
— MethodChecks if the given tree abides the constraint.
HerbConstraints.check_tree
— Methodcheck_tree(c::Forbidden, g::Grammar, tree::RuleNode)::Bool
Checks if the given AbstractRuleNode
tree abides the Forbidden
constraint.
HerbConstraints.check_tree
— MethodChecks if the given tree abides the constraint.
HerbConstraints.check_tree
— MethodChecks if the given tree abides the constraint.
HerbConstraints.check_tree
— MethodChecks if the given tree abides the constraint.
HerbConstraints.check_tree
— Methodcheck_tree(c::Ordered, g::Grammar, tree::RuleNode)::Bool
Checks if the given AbstractRuleNode
tree abides the Ordered
constraint.
HerbConstraints.check_tree
— MethodChecks if the given tree abides the constraint.
HerbConstraints.copy_and_insert
— Methodcopy_and_insert(old_context::GrammarContext, parent::Int)
Copies the given context and insert the parent in the node location.
HerbConstraints.make_smaller_or_equal
— MethodFilters the domain
of the hole at hole_location
in rn₁
to make rn₁
be ordered before rn₂
. Returns the filtered domain, and a boolean indicating if this constraint can be deleted.
HerbConstraints.matchnode2expr
— Methodmatchnode2expr(pattern::MatchNode, grammar::Grammar)
Converts a MatchNode tree into a Julia expression. This is primarily useful for pretty-printing a pattern. Returns the corresponding expression.
HerbConstraints.matchnode2expr
— Methodmatchnode2expr(pattern::MatchVar, grammar::Grammar)
Converts a MatchVar into an expression by returning the variable directly. This is primarily useful for pretty-printing a pattern.
HerbConstraints.propagate
— Methodpropagate(c::Forbidden, g::Grammar, context::GrammarContext, domain::Vector{Int})::Tuple{Vector{Int}, Vector{LocalConstraint}}
Propagates the Forbidden
constraint. It removes the rules from the domain
that would complete the forbidden tree.
Warning The Forbidden
constraint makes use of LocalConstraint
s to make sure that constraints are also enforced in the future when the context of a Hole
changes. Therefore, Forbidden
can only be used in implementations that keep track of the LocalConstraint
s and propagate them at the right moments.
HerbConstraints.propagate
— MethodPropagates the ForbiddenPath
constraint. It removes the elements from the domain that would complete the forbidden sequence.
HerbConstraints.propagate
— MethodPropagates the LocalOneOf constraint. It enforces that at least one of its given constraints hold.
HerbConstraints.propagate
— MethodPropagates the LocalForbidden constraint. It removes rules from the domain that would make the RuleNode at the given path match the pattern defined by the MatchNode.
HerbConstraints.propagate
— MethodPropagates the LocalOrdered constraint. It removes rules from the domain that would violate the order of variables as defined in the constraint.
HerbConstraints.propagate
— MethodPropagates the OneOf constraint. It enforces that at least one of its given constraints hold.
HerbConstraints.propagate
— Methodpropagate(c::Ordered, g::Grammar, context::GrammarContext, domain::Vector{Int})::Tuple{Vector{Int}, Vector{LocalConstraint}}
Propagates the Ordered
constraint. Any rule that violates the order as defined by the contraint is removed from the domain
.
Warning The Ordered
constraint makes use of LocalConstraint
s to make sure that constraints are also enforced in the future when the context of a Hole
changes. Therefore, Ordered
can only be used in implementations that keep track of the LocalConstraint
s and propagate them at the right moments.
HerbConstraints.propagate
— MethodPropagates the RequireOnLeft constraint. It removes every element from the domain that does not have a necessary predecessor in the left subtree.
Index
HerbConstraints.AbstractMatchNode
HerbConstraints.ComesAfter
HerbConstraints.ComesAfter
HerbConstraints.Forbidden
HerbConstraints.ForbiddenPath
HerbConstraints.GrammarContext
HerbConstraints.LocalConstraint
HerbConstraints.LocalForbidden
HerbConstraints.LocalOneOf
HerbConstraints.LocalOrdered
HerbConstraints.MatchFail
HerbConstraints.MatchNode
HerbConstraints.MatchVar
HerbConstraints.OneOf
HerbConstraints.Ordered
HerbConstraints.PropagatorConstraint
HerbConstraints.RequireOnLeft
HerbCore.AbstractRuleNode
HerbCore.Constraint
HerbCore.Grammar
HerbCore.Hole
HerbCore.HoleReference
HerbCore.RuleNode
HerbCore.RuleNode
HerbCore.RuleNode
HerbData.IOExample
HerbData.IOPExample
HerbData.Problem
HerbGrammar.ContextFreeGrammar
HerbGrammar.ContextSensitiveGrammar
HerbGrammar.NodeLoc
HerbGrammar.SymbolTable
HerbGrammar.SymbolTable
HerbSearch.ContextSensitivePriorityEnumerator
HerbSearch.ExpandFailureReason
HerbSearch.ExpressionIterator
HerbSearch.GeneticSearchIterator
HerbSearch.PriorityQueueItem
HerbSearch.PriorityQueueItem
HerbSearch.PropagateResult
HerbSearch.StochasticSearchEnumerator
Base.get
Base.insert!
Base.isless
Base.iterate
Base.iterate
Base.iterate
Base.iterate
Base.iterate
Base.length
Base.length
Base.rand
Base.rand
Base.rand
Base.show
Base.show
HerbConstraints._matchnode2expr
HerbConstraints._matchnode2expr
HerbConstraints._matchnode2expr
HerbConstraints._matchnode2expr
HerbConstraints._pattern_match
HerbConstraints._pattern_match
HerbConstraints._pattern_match_with_hole
HerbConstraints._pattern_match_with_hole
HerbConstraints._pattern_match_with_hole
HerbConstraints._pattern_match_with_hole
HerbConstraints._rulenode_compare
HerbConstraints._rulenode_match_with_hole
HerbConstraints.addparent!
HerbConstraints.annotation2constraint
HerbConstraints.check_tree
HerbConstraints.check_tree
HerbConstraints.check_tree
HerbConstraints.check_tree
HerbConstraints.check_tree
HerbConstraints.check_tree
HerbConstraints.check_tree
HerbConstraints.copy_and_insert
HerbConstraints.make_smaller_or_equal
HerbConstraints.matchnode2expr
HerbConstraints.matchnode2expr
HerbConstraints.propagate
HerbConstraints.propagate
HerbConstraints.propagate
HerbConstraints.propagate
HerbConstraints.propagate
HerbConstraints.propagate
HerbConstraints.propagate
HerbConstraints.propagate
HerbCore.contains_hole
HerbCore.depth
HerbCore.get_node_at_location
HerbCore.get_rulesequence
HerbCore.node_depth
HerbCore.rulesoftype
HerbCore.rulesonleft
HerbCore.swap_node
HerbCore.swap_node
HerbData.read_IOPexamples
HerbData.read_IOexamples
HerbData.readdata
HerbData.readfile
HerbData.write_IOPexamples
HerbData.write_IOexamples
HerbGrammar.add_rule!
HerbGrammar.addconstraint!
HerbGrammar.cfg2csg
HerbGrammar.child_types
HerbGrammar.child_types
HerbGrammar.cleanup_removed_rules!
HerbGrammar.clearconstraints!
HerbGrammar.containedin
HerbGrammar.contains_returntype
HerbGrammar.expr2cfgrammar
HerbGrammar.expr2csgrammar
HerbGrammar.expr2pcfgrammar
HerbGrammar.expr2pcsgrammar
HerbGrammar.get_childtypes
HerbGrammar.get_domain
HerbGrammar.get_domain
HerbGrammar.get_node_at_location
HerbGrammar.get_rulesequence
HerbGrammar.has_children
HerbGrammar.iscomplete
HerbGrammar.iseval
HerbGrammar.iseval
HerbGrammar.iseval
HerbGrammar.isprobabilistic
HerbGrammar.isterminal
HerbGrammar.isterminal
HerbGrammar.isterminal
HerbGrammar.isvariable
HerbGrammar.log_probability
HerbGrammar.max_arity
HerbGrammar.mindepth
HerbGrammar.mindepth_map
HerbGrammar.nchildren
HerbGrammar.nchildren
HerbGrammar.nonterminals
HerbGrammar.probability
HerbGrammar.read_cfg
HerbGrammar.read_csg
HerbGrammar.read_pcfg
HerbGrammar.read_pcsg
HerbGrammar.remove_rule!
HerbGrammar.return_type
HerbGrammar.return_type
HerbGrammar.root_node_loc
HerbGrammar.rulenode2expr
HerbGrammar.rulenode_log_probability
HerbGrammar.rulesoftype
HerbGrammar.rulesoftype
HerbGrammar.rulesoftype
HerbGrammar.rulesonleft
HerbGrammar.store_cfg
HerbGrammar.store_csg
HerbGrammar.subsequenceof
HerbGrammar.swap_node
HerbGrammar.swap_node
HerbInterpret.evaluate_program
HerbInterpret.execute_on_examples
HerbInterpret.interpret
HerbInterpret.test_all_examples
HerbInterpret.test_examples
HerbInterpret.test_with_input
HerbSearch._expand
HerbSearch._expand
HerbSearch._find_next_complete_tree
HerbSearch.best_accept
HerbSearch.calculate_cost
HerbSearch.const_temperature
HerbSearch.constructNeighbourhood
HerbSearch.constructNeighbourhoodRuleSubset
HerbSearch.count_expressions
HerbSearch.count_expressions
HerbSearch.crossover_swap_children_1
HerbSearch.crossover_swap_children_2
HerbSearch.decreasing_temperature
HerbSearch.default_error_function
HerbSearch.default_fitness
HerbSearch.enumerate_neighbours_propose
HerbSearch.get_best_program
HerbSearch.get_bfs_enumerator
HerbSearch.get_bfs_enumerator
HerbSearch.get_dfs_enumerator
HerbSearch.get_dfs_enumerator
HerbSearch.get_genetic_enumerator
HerbSearch.get_mh_enumerator
HerbSearch.get_most_likely_first_enumerator
HerbSearch.get_most_likely_first_enumerator
HerbSearch.get_sa_enumerator
HerbSearch.get_vlsn_enumerator
HerbSearch.heuristic_leftmost
HerbSearch.heuristic_random
HerbSearch.heuristic_rightmost
HerbSearch.heuristic_smallest_domain
HerbSearch.mean_squared_error
HerbSearch.misclassification
HerbSearch.most_likely_priority_function
HerbSearch.mse_error_function
HerbSearch.mutate_random!
HerbSearch.probabilistic_accept
HerbSearch.probabilistic_accept_with_temperature
HerbSearch.probabilistic_accept_with_temperature_fraction
HerbSearch.propagate_constraints
HerbSearch.random_fill_propose
HerbSearch.search
HerbSearch.search_best
HerbSearch.search_rulenode
HerbSearch.select_chromosome
HerbSearch.select_fitness_proportional_parents
HerbSearch.validate_iterator
StatsBase.sample
StatsBase.sample
StatsBase.sample
StatsBase.sample
HerbConstraints.@csgrammar_annotated
HerbGrammar.@cfgrammar
HerbGrammar.@csgrammar
HerbGrammar.@pcfgrammar
HerbGrammar.@pcsgrammar
Settings
This document was generated with Documenter.jl version 0.27.25 on Friday 19 January 2024. Using Julia version 1.8.5.
+end
Base.show
— MethodBase.show(io::IO, node::MatchNode; separator=",", last_child::Bool=true)
Prints a found MatchNode
given an and the respective children to IO
.
Base.show
— MethodBase.show(io::IO, node::MatchVar; separator=",", last_child::Bool=true)
Prints a matching variable assignment described by MatchVar
to IO
.
HerbConstraints._matchnode2expr
— Function_matchnode2expr(expr::Expr, pattern::MatchNode, grammar::Grammar, j=0)
Internal function for matchnode2expr
, recursively iterating over a matched pattern and converting it to an expression. This is primarily useful for pretty-printing a pattern. Returns the corresponding expression and the current child index.
HerbConstraints._matchnode2expr
— Function_matchnode2expr(typ::Symbol, pattern::MatchNode, grammar::Grammar, j=0)
Internal function for matchnode2expr
, returning the matched translated symbol. This is primarily useful for pretty-printing a pattern. Returns the corresponding expression, i.e. the variable name and the current child index.
HerbConstraints._matchnode2expr
— Function_matchnode2expr(expr::Expr, pattern::MatchVar, grammar::Grammar, j=0)
Internal function for matchnode2expr
, recursively iterating over a matched variable and converting it to an expression. This is primarily useful for pretty-printing a pattern. Returns the corresponding expression and the current child index.
HerbConstraints._matchnode2expr
— Function_matchnode2expr(typ::Symbol, pattern::MatchVar, grammar::Grammar, j=0)
Internal function for matchnode2expr
. This is primarily useful for pretty-printing a pattern. Returns the corresponding expression, i.e. the variable name and the current child index.
HerbConstraints._pattern_match
— Method_pattern_match(rn::RuleNode, mn::MatchNode, vars::Dict{Symbol, AbstractRuleNode})::Union{Nothing, MatchFail}
Tries to match RuleNode
rn
with MatchNode
mn
. Modifies the variable assignment dictionary vars
. Returns nothing
if the match is successful. If the match is unsuccessful, it returns whether it is a softfail or hardfail (see MatchFail
docstring)
HerbConstraints._pattern_match
— Method_pattern_match(rn::RuleNode, mv::MatchVar, vars::Dict{Symbol, AbstractRuleNode})::Union{Nothing, MatchFail}
Matching RuleNode
rn
with MatchVar
mv
. If the variable is already assigned, the rulenode is matched with the specific variable value. Returns nothing
if the match is succesful. If the match is unsuccessful, it returns whether it is a softfail or hardfail (see MatchFail
docstring)
HerbConstraints._pattern_match_with_hole
— Method_pattern_match_with_hole(::Hole, mn::MatchNode, hole_location::Vector{Int}, ::Dict{Symbol, AbstractRuleNode})::Union{Int, Symbol, MatchFail, Tuple{Symbol, Vector{Int}}}
Matches the Hole
with the given MatchNode
.
TODO check this behaviour?
HerbConstraints._pattern_match_with_hole
— Method_pattern_match_with_hole(::Hole, mn::MatchNode, hole_location::Vector{Int}, ::Dict{Symbol, AbstractRuleNode})::Union{Int, Symbol, MatchFail, Tuple{Symbol, Vector{Int}}}
Matches the Hole
with the given MatchVar
, similar to _pattern_match_with_hole
.
HerbConstraints._pattern_match_with_hole
— Method_pattern_match_with_hole(rn::RuleNode, mn::MatchNode, hole_location::Vector{Int}, vars::Dict{Symbol, AbstractRuleNode})::Union{Int, Symbol, MatchFail, Tuple{Symbol, Vector{Int}}}
Tries to match RuleNode
rn
with MatchNode
mn
and fill in the domain of the hole at hole_location
. Returns if match is successful either:
- The id for the node which fills the hole
- A symbol for the variable that fills the hole
- A tuple containing:
- The variable that matched (the subtree containing) the hole
- The location of the hole in this subtree
If the match is unsuccessful, it returns:
- hardfail if there are no holes that can be filled in such a way that the match will become succesful
- softfail if the match could become successful if the holes are filled in a certain way
HerbConstraints._pattern_match_with_hole
— Method_pattern_match_with_hole(rn::RuleNode, mv::MatchVar, hole_location::Vector{Int}, vars::Dict{Symbol, AbstractRuleNode})::Union{Int, Symbol, MatchFail, Tuple{Symbol, Vector{Int}}}
Tries to match RuleNode
rn
with MatchVar
mv
and fill in the domain of the hole at hole_location
. If the variable name is already assigned in vars
, the rulenode is matched with the hole. Otherwise the variable and the hole location are returned.
HerbConstraints._rulenode_compare
— Method- Returns -1 if rn₁ < rn₂
- Returns 0 if rn₁ == rn₂
- Returns 1 if rn₁ > rn₂
HerbConstraints._rulenode_match_with_hole
— Method_rulenode_match_with_hole(rn₁::RuleNode, rn₂::RuleNode, hole_location::Vector{Int})::Union{Int, MatchFail}
Matches two rulenodes. Returns how to fill in the hole in rn₁ to make it match rn₂ if:
- rn₁ has a single hole at the provided location
- rn₂ doesn't have any holes
- rn₁ matches rn₂ apart from the single hole location.
If the match fails, it returns whether it is a softfail or a hardfail (see MatchFail docstring)
HerbConstraints.addparent!
— Methodaddparent!(context::GrammarContext, parent::Int)
Adds a parent to the context. The parent is defined by the grammar rule id.
HerbConstraints.annotation2constraint
— MethodConverts an annotation to a constraint. commutative: creates an Ordered constraint transitive: creates an (incorrect) Forbidden constraint forbidden_path(path::Vector{Union{Symbol, Int}}): creates a ForbiddenPath constraint with the original rule included ... || ...: creates a OneOf constraint (also works with ... || ... || ... et cetera, though not very performant)
HerbConstraints.check_tree
— MethodChecks if the given tree abides the constraint.
HerbConstraints.check_tree
— Methodcheck_tree(c::Forbidden, g::Grammar, tree::RuleNode)::Bool
Checks if the given AbstractRuleNode
tree abides the Forbidden
constraint.
HerbConstraints.check_tree
— MethodChecks if the given tree abides the constraint.
HerbConstraints.check_tree
— MethodChecks if the given tree abides the constraint.
HerbConstraints.check_tree
— MethodChecks if the given tree abides the constraint.
HerbConstraints.check_tree
— Methodcheck_tree(c::Ordered, g::Grammar, tree::RuleNode)::Bool
Checks if the given AbstractRuleNode
tree abides the Ordered
constraint.
HerbConstraints.check_tree
— MethodChecks if the given tree abides the constraint.
HerbConstraints.copy_and_insert
— Methodcopy_and_insert(old_context::GrammarContext, parent::Int)
Copies the given context and insert the parent in the node location.
HerbConstraints.make_smaller_or_equal
— MethodFilters the domain
of the hole at hole_location
in rn₁
to make rn₁
be ordered before rn₂
. Returns the filtered domain, and a boolean indicating if this constraint can be deleted.
HerbConstraints.matchnode2expr
— Methodmatchnode2expr(pattern::MatchNode, grammar::Grammar)
Converts a MatchNode tree into a Julia expression. This is primarily useful for pretty-printing a pattern. Returns the corresponding expression.
HerbConstraints.matchnode2expr
— Methodmatchnode2expr(pattern::MatchVar, grammar::Grammar)
Converts a MatchVar into an expression by returning the variable directly. This is primarily useful for pretty-printing a pattern.
HerbConstraints.propagate
— Methodpropagate(c::Forbidden, g::Grammar, context::GrammarContext, domain::Vector{Int})::Tuple{Vector{Int}, Vector{LocalConstraint}}
Propagates the Forbidden
constraint. It removes the rules from the domain
that would complete the forbidden tree.
The Forbidden
constraint makes use of LocalConstraint
s to make sure that constraints are also enforced in the future when the context of a Hole
changes. Therefore, Forbidden
can only be used in implementations that keep track of the LocalConstraint
s and propagate them at the right moments.
HerbConstraints.propagate
— MethodPropagates the ForbiddenPath
constraint. It removes the elements from the domain that would complete the forbidden sequence.
HerbConstraints.propagate
— MethodPropagates the LocalOneOf constraint. It enforces that at least one of its given constraints hold.
HerbConstraints.propagate
— MethodPropagates the LocalForbidden constraint. It removes rules from the domain that would make the RuleNode at the given path match the pattern defined by the MatchNode.
HerbConstraints.propagate
— MethodPropagates the LocalOrdered constraint. It removes rules from the domain that would violate the order of variables as defined in the constraint.
HerbConstraints.propagate
— MethodPropagates the OneOf constraint. It enforces that at least one of its given constraints hold.
HerbConstraints.propagate
— Methodpropagate(c::Ordered, g::Grammar, context::GrammarContext, domain::Vector{Int})::Tuple{Vector{Int}, Vector{LocalConstraint}}
Propagates the Ordered
constraint. Any rule that violates the order as defined by the contraint is removed from the domain
.
The Ordered
constraint makes use of LocalConstraint
s to make sure that constraints are also enforced in the future when the context of a Hole
changes. Therefore, Ordered
can only be used in implementations that keep track of the LocalConstraint
s and propagate them at the right moments.
HerbConstraints.propagate
— MethodPropagates the RequireOnLeft constraint. It removes every element from the domain that does not have a necessary predecessor in the left subtree.
Index
HerbConstraints.AbstractMatchNode
HerbConstraints.ComesAfter
HerbConstraints.ComesAfter
HerbConstraints.Forbidden
HerbConstraints.ForbiddenPath
HerbConstraints.GrammarContext
HerbConstraints.LocalConstraint
HerbConstraints.LocalForbidden
HerbConstraints.LocalOneOf
HerbConstraints.LocalOrdered
HerbConstraints.MatchFail
HerbConstraints.MatchNode
HerbConstraints.MatchVar
HerbConstraints.OneOf
HerbConstraints.Ordered
HerbConstraints.PropagatorConstraint
HerbConstraints.RequireOnLeft
HerbCore.AbstractRuleNode
HerbCore.Constraint
HerbCore.Grammar
HerbCore.Hole
HerbCore.HoleReference
HerbCore.RuleNode
HerbCore.RuleNode
HerbCore.RuleNode
HerbData.IOExample
HerbData.IOPExample
HerbData.Problem
HerbGrammar.ContextFreeGrammar
HerbGrammar.ContextSensitiveGrammar
HerbGrammar.NodeLoc
HerbGrammar.SymbolTable
HerbGrammar.SymbolTable
HerbSearch.ContextSensitivePriorityEnumerator
HerbSearch.ExpandFailureReason
HerbSearch.ExpressionIterator
HerbSearch.GeneticSearchIterator
HerbSearch.PriorityQueueItem
HerbSearch.PriorityQueueItem
HerbSearch.PropagateResult
HerbSearch.StochasticSearchEnumerator
Base.get
Base.insert!
Base.isless
Base.iterate
Base.iterate
Base.iterate
Base.iterate
Base.iterate
Base.length
Base.length
Base.rand
Base.rand
Base.rand
Base.show
Base.show
HerbConstraints._matchnode2expr
HerbConstraints._matchnode2expr
HerbConstraints._matchnode2expr
HerbConstraints._matchnode2expr
HerbConstraints._pattern_match
HerbConstraints._pattern_match
HerbConstraints._pattern_match_with_hole
HerbConstraints._pattern_match_with_hole
HerbConstraints._pattern_match_with_hole
HerbConstraints._pattern_match_with_hole
HerbConstraints._rulenode_compare
HerbConstraints._rulenode_match_with_hole
HerbConstraints.addparent!
HerbConstraints.annotation2constraint
HerbConstraints.check_tree
HerbConstraints.check_tree
HerbConstraints.check_tree
HerbConstraints.check_tree
HerbConstraints.check_tree
HerbConstraints.check_tree
HerbConstraints.check_tree
HerbConstraints.copy_and_insert
HerbConstraints.make_smaller_or_equal
HerbConstraints.matchnode2expr
HerbConstraints.matchnode2expr
HerbConstraints.propagate
HerbConstraints.propagate
HerbConstraints.propagate
HerbConstraints.propagate
HerbConstraints.propagate
HerbConstraints.propagate
HerbConstraints.propagate
HerbConstraints.propagate
HerbCore.contains_hole
HerbCore.depth
HerbCore.get_node_at_location
HerbCore.get_rulesequence
HerbCore.node_depth
HerbCore.rulesoftype
HerbCore.rulesonleft
HerbCore.swap_node
HerbCore.swap_node
HerbData.read_IOPexamples
HerbData.read_IOexamples
HerbData.readdata
HerbData.readfile
HerbData.write_IOPexamples
HerbData.write_IOexamples
HerbGrammar.add_rule!
HerbGrammar.addconstraint!
HerbGrammar.cfg2csg
HerbGrammar.child_types
HerbGrammar.child_types
HerbGrammar.cleanup_removed_rules!
HerbGrammar.clearconstraints!
HerbGrammar.containedin
HerbGrammar.contains_returntype
HerbGrammar.expr2cfgrammar
HerbGrammar.expr2csgrammar
HerbGrammar.expr2pcfgrammar
HerbGrammar.expr2pcsgrammar
HerbGrammar.get_childtypes
HerbGrammar.get_domain
HerbGrammar.get_domain
HerbGrammar.get_node_at_location
HerbGrammar.get_rulesequence
HerbGrammar.has_children
HerbGrammar.iscomplete
HerbGrammar.iseval
HerbGrammar.iseval
HerbGrammar.iseval
HerbGrammar.isprobabilistic
HerbGrammar.isterminal
HerbGrammar.isterminal
HerbGrammar.isterminal
HerbGrammar.isvariable
HerbGrammar.log_probability
HerbGrammar.max_arity
HerbGrammar.mindepth
HerbGrammar.mindepth_map
HerbGrammar.nchildren
HerbGrammar.nchildren
HerbGrammar.nonterminals
HerbGrammar.probability
HerbGrammar.read_cfg
HerbGrammar.read_csg
HerbGrammar.read_pcfg
HerbGrammar.read_pcsg
HerbGrammar.remove_rule!
HerbGrammar.return_type
HerbGrammar.return_type
HerbGrammar.root_node_loc
HerbGrammar.rulenode2expr
HerbGrammar.rulenode_log_probability
HerbGrammar.rulesoftype
HerbGrammar.rulesoftype
HerbGrammar.rulesoftype
HerbGrammar.rulesonleft
HerbGrammar.store_cfg
HerbGrammar.store_csg
HerbGrammar.subsequenceof
HerbGrammar.swap_node
HerbGrammar.swap_node
HerbInterpret.evaluate_program
HerbInterpret.execute_on_examples
HerbInterpret.interpret
HerbInterpret.test_all_examples
HerbInterpret.test_examples
HerbInterpret.test_with_input
HerbSearch._expand
HerbSearch._expand
HerbSearch._find_next_complete_tree
HerbSearch.best_accept
HerbSearch.calculate_cost
HerbSearch.const_temperature
HerbSearch.constructNeighbourhood
HerbSearch.constructNeighbourhoodRuleSubset
HerbSearch.count_expressions
HerbSearch.count_expressions
HerbSearch.crossover_swap_children_1
HerbSearch.crossover_swap_children_2
HerbSearch.decreasing_temperature
HerbSearch.default_error_function
HerbSearch.default_fitness
HerbSearch.enumerate_neighbours_propose
HerbSearch.get_best_program
HerbSearch.get_bfs_enumerator
HerbSearch.get_bfs_enumerator
HerbSearch.get_dfs_enumerator
HerbSearch.get_dfs_enumerator
HerbSearch.get_genetic_enumerator
HerbSearch.get_mh_enumerator
HerbSearch.get_most_likely_first_enumerator
HerbSearch.get_most_likely_first_enumerator
HerbSearch.get_sa_enumerator
HerbSearch.get_vlsn_enumerator
HerbSearch.heuristic_leftmost
HerbSearch.heuristic_random
HerbSearch.heuristic_rightmost
HerbSearch.heuristic_smallest_domain
HerbSearch.mean_squared_error
HerbSearch.misclassification
HerbSearch.most_likely_priority_function
HerbSearch.mse_error_function
HerbSearch.mutate_random!
HerbSearch.probabilistic_accept
HerbSearch.probabilistic_accept_with_temperature
HerbSearch.probabilistic_accept_with_temperature_fraction
HerbSearch.propagate_constraints
HerbSearch.random_fill_propose
HerbSearch.search
HerbSearch.search_best
HerbSearch.search_rulenode
HerbSearch.select_chromosome
HerbSearch.select_fitness_proportional_parents
HerbSearch.validate_iterator
StatsBase.sample
StatsBase.sample
StatsBase.sample
StatsBase.sample
HerbConstraints.@csgrammar_annotated
HerbGrammar.@cfgrammar
HerbGrammar.@csgrammar
HerbGrammar.@pcfgrammar
HerbGrammar.@pcsgrammar