Synthesis of P-Stable Abstractions