Draft of a type inference over rules.