S4 type system