Constraint-Based Grammar Formalisms: Parsing and Type Inference for Natural and Computer Languages