def sum_expr(printer, ast):
    """Prints expression "sum (name:type) expr"."""
    var_name_str = ast["varName"]
    type_str = printer.ast_to_string(ast["type"])
    expr_str = printer.ast_to_string(ast["expr"])
    return f'sum ({var_name_str} : {type_str}) {expr_str}'