def array_subscripts(expr):
    """Given a subscript expression expr (i.e., an expression that denotes the
       set of elements of some array that are to be accessed), 
       array_subscripts() returns a list of the elements denoted by expr."""
    if isinstance(expr, Array):
        return all_subs(expr._bounds)
    elif isinstance(expr, list):
        subs = [subscripts(x) for x in expr]
        return flatten(subs)
    else:
        return [expr]