First Order Logic Partition Algorithm