Dcalc.TypingSourceTyping for the default calculus. Because of the error terms, we perform type inference using the classical W algorithm with union-find unification.
val infer_types :
Ast.decl_ctx ->
Ast.untyped Ast.marked_expr ->
Ast.typed Ast.marked_expr Bindlib.boxInfers types everywhere on the given expression, and adds (or replaces) type annotations on each node
Gets the outer type of the given expression, using either the existing annotations or inference