Layout inference tool