Typing Lambda Terms in Elementary Logic with Linear Constraints