type checking algorithms for various type systems