The form and function of legal precedent