Logics for Coalgebras and Application to Computer Science