code: def ast2expr(ast):
      
      if ast[0] == 'const':
          return _CONSTS[ast[1]]
      elif ast[0] == 'var':
          return exprvar(ast[1], ast[2])
      else:
          xs = [ast2expr(x) for x in ast[1:]]
          return ASTOPS[ast[0]](*xs, simplify=False)
docs: Convert an abstract syntax tree to an Expression.