New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix expression depth definition #92

cjdrake opened this Issue May 20, 2014 · 0 comments


None yet
1 participant

cjdrake commented May 20, 2014

The current definition of Expression.depth is a bit weird. In particular:

  • The Not gate does not add a level of depth
  • The Xor, Xnor, Equal, Unequal, ITE, gates add two levels of depth

Also, the calculation is a bit wasteful. It calculates max(arg.depth + 1 for arg in self.args). It would be cheaper to calculate max(arg.depth for arg in self.args) + 1.

@cjdrake cjdrake added the Change label May 20, 2014

cjdrake added a commit that referenced this issue May 21, 2014

@cjdrake cjdrake closed this May 21, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment