Type Logics in Grammar