human
Complete this python program:
def chain(*rules):
assistant
#Here is the Python program you requested.

    """Compose a sequence of rules so that they apply to the expr sequentially
    """
    def chain_rl(expr):
        for rule in rules:
            expr = rule(expr)
        return expr
    return chain_rl