SMS: Algebraic theories