def rebuild(cluster, exprs, subs, schedule):
    '\n    Plug the optimized aliases into the input Cluster. This leads to creating\n    a new Cluster with suitable IterationSpace and DataSpace.\n    '
    exprs = [uxreplace(e, subs) for e in exprs]
    ispace = cluster.ispace.augment(schedule.dmapper)
    ispace = ispace.augment(schedule.rmapper)
    accesses = detect_accesses(exprs)
    parts = {k: IntervalGroup(build_intervals(v)).relaxed for (k, v) in accesses.items() if k}
    dspace = DataSpace(cluster.dspace.intervals, parts)
    return cluster.rebuild(exprs=exprs, ispace=ispace, dspace=dspace)
Plug the optimized aliases into the input Cluster. This leads to creating
a new Cluster with suitable IterationSpace and DataSpace.
def rebuild(cluster, exprs, subs, schedule):
    '\n    Plug the optimized aliases into the input Cluster. This leads to creating\n    a new Cluster with suitable IterationSpace and DataSpace.\n    '
    exprs = [uxreplace(e, subs) for e in exprs]
    ispace = cluster.ispace.augment(schedule.dmapper)
    ispace = ispace.augment(schedule.rmapper)
    accesses = detect_accesses(exprs)
    parts = {k: IntervalGroup(build_intervals(v)).relaxed for (k, v) in accesses.items() if k}
    dspace = DataSpace(cluster.dspace.intervals, parts)
    return cluster.rebuild(exprs=exprs, ispace=ispace, dspace=dspace)