A Framework for Defining Logics