code: def _expr2bddnode(expr):
      
      if expr.is_zero():
          return BDDNODEZERO
      elif expr.is_one():
          return BDDNODEONE
      else:
          top = expr.top
  
          # Register this variable
          _ = bddvar(top.names, top.indices)
  
          root = top.uniqid
          lo = _expr2bddnode(expr.restrict({top: 0}))
          hi = _expr2bddnode(expr.restrict({top: 1}))
          return _bddnode(root, lo, hi)
docs: Convert an expression into a BDD node.