This issue introduces basic interfaces for performing type inference. It includes validation of input types and deduction of accumulator or return types. Argument type inference (i.e. deducing a type for NULL) will be introduced in a later step. The interfaces replace the need for PlannerExpression.
A rough design document can be found here but it needs some update. Introduction of annotations and basic type extraction will come later: