@staticmethod
def detect(patch, stmts_bef, stmts_aft, actions):
    l = [(a.frm(), a.to()) for a in actions['ModifyAssignment']]
    l = [(frm, to) for (frm, to) in l if frm.op().equivalent(to.op())]
    l = [(frm, to) for (frm, to) in l if frm.lhs().equivalent(to.lhs())]
    l = [(frm, to) for (frm, to) in l if (not frm.rhs().equivalent(to.rhs()))]
    actions['ReplaceAssignmentRHS'] = [ReplaceAssignmentRHS(frm, to) for (frm, to) in l]
@staticmethod
def detect(patch, stmts_bef, stmts_aft, actions):
    l = [(a.frm(), a.to()) for a in actions['ModifyAssignment']]
    l = [(frm, to) for (frm, to) in l if frm.op().equivalent(to.op())]
    l = [(frm, to) for (frm, to) in l if frm.lhs().equivalent(to.lhs())]
    l = [(frm, to) for (frm, to) in l if (not frm.rhs().equivalent(to.rhs()))]
    actions['ReplaceAssignmentRHS'] = [ReplaceAssignmentRHS(frm, to) for (frm, to) in l]