code: def to_dot(self, name='EXPR'): # pragma: no cover
          
          parts = ['graph', name, '{', 'rankdir=BT;']
          for ex in self.iter_dfs():
              exid = ex.node.id()
              if ex is Zero:
                  parts += ["n{} [label=0,shape=box];".format(exid)]
              elif ex is One:
                  parts += ["n{} [label=1,shape=box];".format(exid)]
              elif isinstance(ex, Literal):
                  parts += ['n{} [label="{}",shape=box];'.format(exid, ex)]
              else:
                  parts += ["n{0} [label={1.ASTOP},shape=circle];".format(exid, ex)]
          for ex in self.iter_dfs():
              exid = ex.node.id()
              if isinstance(ex, NotOp):
                  parts += ["n{} -- n{};".format(ex.x.node.id(), exid)]
              elif isinstance(ex, ImpliesOp):
                  p, q = ex.xs
                  parts += ["n{} -- n{} [label=p];".format(p.node.id(), exid)]
                  parts += ["n{} -- n{} [label=q];".format(q.node.id(), exid)]
              elif isinstance(ex, IfThenElseOp):
                  s, d1, d0 = ex.xs
                  parts += ["n{} -- n{} [label=s];".format(s.node.id(), exid)]
                  parts += ["n{} -- n{} [label=d1];".format(d1.node.id(), exid)]
                  parts += ["n{} -- n{} [label=d0];".format(d0.node.id(), exid)]
              elif isinstance(ex, NaryOp):
                  for x in ex.xs:
                      parts += ["n{} -- n{};".format(x.node.id(), exid)]
          parts.append('}')
          return " ".join(parts)
docs: Convert to DOT language representation.