refactor; fix sewing prover if-then-else; emit in java code