Inverting Inductively Defined Relations in LEGO