Compositional inference of principal typings for simple lamda-calculus based language written in C++