You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#HerbCore""" isfilled(node::AbstractRuleNode)::BoolReturns whether the [`AbstractRuleNode`] holds a single rule.Holes are considered to be "filled" iff their domain size is exactly 1."""isfilled(rn::RuleNode)::Bool=trueisfilled(hole::UniformHole)::Bool= (sum(hole.domain) ==1)
isfilled(hole::Hole)::Bool= (sum(hole.domain) ==1)
#HerbConstaintsfunction HerbCore.isfilled(hole::StateHole)::Boolreturnsize(hole.domain) ==1end
Target implementation
#HerbCore""" isfilled(node::AbstractRuleNode)::BoolReturns whether the [`AbstractRuleNode`] holds a single rule.Holes are considered to be "filled" iff their domain size is exactly 1."""isfilled(rn::RuleNode)::Bool=trueisfilled(hole::AbstractHole)::Bool=false#HerbConstaintsfunction HerbCore.isfilled(hole::StateHole)::Boolreturnsize(hole.domain) ==1end
The GenericSolver automatically replaces filled holes with a rulenode, so UniformHoles and Holes will in practice always be not filled. Propagators often check this property by calling isfilled function, which currently takes $O(n)$ (for BitVectors).
We can exploit this by redefining isfilled(hole::AbstractHole)::Bool = false. However, this might cause bugs if the implementation of the GenericSolver changes.
For StateHoles, isfilled must remain the way it is, because state holes are not getting replaced by a rule node on fill. Also, for a statehole, size(hole.domain) is $O(1)$.
The text was updated successfully, but these errors were encountered:
Current implementation
Target implementation
The GenericSolver automatically replaces filled holes with a rulenode, so$O(n)$ (for BitVectors).
UniformHole
s andHole
s will in practice always be not filled. Propagators often check this property by callingisfilled
function, which currently takesWe can exploit this by redefining
isfilled(hole::AbstractHole)::Bool = false
. However, this might cause bugs if the implementation of the GenericSolver changes.For StateHoles,$O(1)$ .
isfilled
must remain the way it is, because state holes are not getting replaced by a rule node on fill. Also, for a statehole,size(hole.domain)
isThe text was updated successfully, but these errors were encountered: