code: def _restrict(node, npoint, cache=None):
      
      if node is BDDNODEZERO or node is BDDNODEONE:
          return node
  
      if cache is None:
          cache = dict()
  
      try:
          ret = cache[node]
      except KeyError:
          try:
              val = npoint[node.root]
          except KeyError:
              lo = _restrict(node.lo, npoint, cache)
              hi = _restrict(node.hi, npoint, cache)
              ret = _bddnode(node.root, lo, hi)
          else:
              child = {BDDNODEZERO: node.lo, BDDNODEONE: node.hi}[val]
              ret = _restrict(child, npoint, cache)
          cache[node] = ret
      return ret
docs: Restrict a subset of support variables to {0, 1}.