contain k@(Plus a b) r
    | isPlus a = partial || ((left a) `Plus` ((right a) `Plus` b)) `contain` r
    | otherwise = partial
        where partial = a `contain` r || b `contain` r || k == r
contain k@(Plus a b) r
    | isPlus a = partial || ((left a) `Plus` ((right a) `Plus` b)) `contain` r
    | otherwise = partial
        where partial = a `contain` r || b `contain` r || k == r
contain k@(Plus a b) r
    | isPlus a = partial || ((left a) `Plus` ((right a) `Plus` b)) `contain` r
    | otherwise = partial
        where partial = a `contain` r || b `contain` r || k == r