# Path: sdopt/nodes/attributes.py
# class NodeAttr:
#     bounds    =  1
#     con_num   =  2
#     d_term    =  3
#     display   =  4
#     input_ord =  5
#     n_term    =  6
#     name      =  7
#     node_id   =  8
#     number    =  9
#     operation = 10
#     type      = 11
#     var_num   = 12
# 
# Path: sdopt/nodes/types.py
# class ntype:
#     DIV = 'div'
#     EXP = 'exp'
#     LOG = 'log'
#     MUL = 'mul'
#     NEG = 'neg'
#     NUM = 'num'
#     POW = 'pow'
#     SQR = 'sqr'
#     SUM = 'sum'
#     VAR = 'var'
# 
# Path: sdopt/representation/dag_util.py
# def add_keep_smaller_value(mapping, key, value):
#     # mapping[key]=value BUT if key is already present, keeps smaller value
#     old_value = mapping.get(key,  value)
#     mapping[key] = min(old_value, value)


from ..nodes.attributes import NodeAttr
from ..nodes.types import ntype
from ..representation.dag_util import add_keep_smaller_value

# TODO Factor out duplication

def div_setup(node_id, d, problem):
    d[NodeAttr.display] = d[NodeAttr.operation]
    
def exp_setup(node_id, d, problem):
    d[NodeAttr.display] = d[NodeAttr.operation]    

def log_setup(node_id, d, problem):

# Path: sdopt/nodes/attributes.py
# class NodeAttr:
#     bounds    =  1
#     con_num   =  2
#     d_term    =  3
#     display   =  4
#     input_ord =  5
#     n_term    =  6
#     name      =  7
#     node_id   =  8
#     number    =  9
#     operation = 10
#     type      = 11
#     var_num   = 12
# 
# Path: sdopt/nodes/types.py
# class ntype:
#     DIV = 'div'
#     EXP = 'exp'
#     LOG = 'log'
#     MUL = 'mul'
#     NEG = 'neg'
#     NUM = 'num'
#     POW = 'pow'
#     SQR = 'sqr'
#     SUM = 'sum'
#     VAR = 'var'
# 
# Path: sdopt/representation/dag_util.py
# def add_keep_smaller_value(mapping, key, value):
#     # mapping[key]=value BUT if key is already present, keeps smaller value
#     old_value = mapping.get(key,  value)
#     mapping[key] = min(old_value, value)


# Path: sdopt/nodes/setup.py
from ..nodes.attributes import NodeAttr
from ..nodes.types import ntype
from ..representation.dag_util import add_keep_smaller_value


# TODO Factor out duplication

def div_setup(node_id, d, problem):
    d[NodeAttr.display] = d[NodeAttr.operation]
    
def exp_setup(node_id, d, problem):
    d[NodeAttr.display] = d[NodeAttr.operation]    

def log_setup(node_id, d, problem):

    d[NodeAttr.display] = d[NodeAttr.operation]