• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

johnyf / dd / 169 / 2
81%
master: 88%

Build:
Build:
LAST BUILD BRANCH: v0.5.4
DEFAULT BRANCH: master
Ran 22 Feb 2017 08:39AM UTC
Files 11
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

22 Feb 2017 08:02AM UTC coverage: 80.586% (-0.03%) from 80.616%
CC=gcc-4.7 CXX=g++-4.7

push

travis-ci

johnyf
API: add method `Function.__hash__`

to `autoref, cudd, sylvan` interfaces. Together with the existing
comparator methods, this defines `Function` as hashable.

Previously nodes weren't hashable, even though Python by default
lets user-defined types be hashable, because the presence of
a `__richcmp__` or other comparator method overrides this default
behavior [2].

As the definition of hashable object requires, we implement
`__hash__` so as to ensure that equal `Function` objects have
the same hash value. Nodes that belong to different managers
won't compare equal, so hash conflicts won't cause problems.

That node instances of the same manager with the same pointer (or
same integer node value, in the case of `dd.autoref`) are the same
entity relies on the uniqueness of representation in a BDD.

The only aspects of a node wrapped by a `Function` instance
that can change are the reference count and level of the
corresponding variable. These aren't inherent properties of
the node, and they are the same for all `Function` instances
that wrap that same node, because these values are obtained
from the manager. Thus, BDD nodes are indeed immutable entities.

[1] https://docs.python.org/3/glossary.html
[2] https://docs.python.org/3/reference/datamodel.html#object.__hash__

1623 of 2014 relevant lines covered (80.59%)

0.81 hits per line

Source Files on job 169.2 (CC=gcc-4.7 CXX=g++-4.7)
  • Tree
  • List 0
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 169
  • Travis Job 169.2
  • 0b29f9f7 on github
  • Prev Job for CC=gcc-4.7 CXX=g++-4.7 on dev_0.5.0 (#168.2)
  • Next Job for CC=gcc-4.7 CXX=g++-4.7 on dev_0.5.0 (#170.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc