Reason with Shapes and Their Attributes