Skip to content

(At least) ExactSumConstraint doesn't handle negative numbers properly #33

@ltskinol

Description

@ltskinol
myth1 python-constraint-master # python
Python 2.7.12 (default, Dec 17 2016, 17:32:09)
[GCC 4.9.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from constraint import *
>>> p = Problem()
>>> p.addVariable('a', [-1,0,1])
>>> p.addVariable('b', [-1,0,1])
>>> p.addConstraint(ExactSumConstraint(0), ['a', 'b'])
>>> print p.getSolutions()
[{'a': 0, 'b': 0}]
>>>

Shouldn't a==-1, b==1 and a==1, b==-1 also be solutions?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions