Functorial Semantics for Partial Theories