extract_proofs: use match in alg