<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def stmt2dzn(name, val, declare=True, assign=True, wrap=True):
 """Returns a dzn statement declaring and assigning the given value. Parameters val The value to serialize. declare : bool Whether to include the declaration of the variable in the statement or just the assignment. assign : bool Wheter to include the assignment of the value in the statement or just the declaration. wrap : bool Whether to wrap the serialized value. Returns ------- str The serialized dzn representation of the value. """

    if not (declare or assign):
        raise ValueError(
            'The statement must be a declaration or an assignment.'
        )

    stmt = []
    if declare:
        val_type = _dzn_type(val)
        stmt.append('{}: '.format(val_type))
    stmt.append(name)
    if assign:
        val_str = val2dzn(val, wrap=wrap)
        stmt.append(' = {}'.format(val_str))
    stmt.append(';')
    return ''.join(stmt)