code: func (ref Ref) GroundPrefix() Ref {
  	prefix := make(Ref, 0, len(ref))
  
  	for i, x := range ref {
  		if i > 0 && !x.IsGround() {
  			break
  		}
  		prefix = append(prefix, x)
  	}
  
  	return prefix
  }
docs: // GroundPrefix returns the ground portion of the ref starting from the head. By
  // definition, the head of the reference is always ground.