-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
Unfortunately commit 13f8c40 part of d79ddb0 introduced a bug to class Inhibitor.
In case where a place is unmarked the example Inhibitor(Variable("x")).check(Substitution(x=1), MultiSet([1, 2, 3])) becomes Inhibitor(Variable("x")).check(Substitution(), MultiSet([])) and class Variable throws an exception inside its method bind because the parameter binding does not include self.name.
This might be a quick fix inspired by the modes method:
def check (self, binding, tokens) :
"""Check whether the label allows to fire with tokens
>>> Inhibitor(Value(1)).check(Substitution(), MultiSet([1, 2, 3]))
False
>>> Inhibitor(Value(4)).check(Substitution(), MultiSet([1, 2, 3]))
True
>>> Inhibitor(Variable("x")).check(Substitution(x=1), MultiSet([1, 2, 3]))
False
>>> Inhibitor(Variable("x")).check(Substitution(x=4), MultiSet([1, 2, 3]))
True
"""
try :
checks = self._annotation.check(binding, tokens)
except DomainError :
checks = False
return (not checks
and self._condition(binding))Metadata
Metadata
Assignees
Labels
No labels