thesis (involving rewriting and Kan extensions)