formalize Curry type system (first version)