Validation and Automatic Repair of Planar Partitions