code: def eager_reduce_add(op, arg, reduced_vars):
      # reduce Constant.arg.inputs
      result = arg.arg
      if reduced_vars - arg.const_vars:
          result = result.reduce(op, reduced_vars - arg.const_vars)
  
      # reduce Constant.const_inputs
      reduced_const_vars = reduced_vars & arg.const_vars
      if reduced_const_vars:
          # only Bint types are supported
          assert all(
              var.output.dtype != "real" for var in reduced_const_vars
          )
          size = reduce(
              ops.mul, (var.output.size for var in reduced_const_vars)
          )
          # other ops like min/max can also be supported if necessary
          if op is ops.add:
              prod_op = ops.mul
          elif op is ops.mul:
              prod_op = ops.pow
          elif op is ops.logaddexp:
              prod_op = ops.add
              size = ops.log(size)
          result = prod_op(result, size)
          const_vars = arg.const_vars - reduced_const_vars
          const_inputs = OrderedDict(
              (v.name, v.output) for v in const_vars
          )
          if const_inputs:
              return Constant(const_inputs, result)
          return result
      return Constant(arg.const_inputs, result)
  
file_path: funsor/funsor/constant.py
imports: from collections import OrderedDict
  from functools import reduce
  import funsor.ops
  from funsor.tensor import Tensor
  from funsor.terms import Binary, Funsor, FunsorMeta, Number, Reduce, Unary, Variable, eager
label_desc: Use image node_id 1 for calling a global function with example usage: eager_reduce_add(op, arg, reduced_vars) and returns: Constant, result, Constant