A Goal-Dependent Abstraction for Legal Reasoning by Analogy