function serializeProofVerdict(proof) {
    const verdict = proof?.finalVerdict ?? proof?.verdict ?? proof?.verificationState ?? proof?.acceptanceState;
    return verdict ? String(verdict) : null;
}
export function serializeProof(proof) {
    if (!proof || typeof proof !== 'object') {
        return proof ?? null;
    }
    return {
        ...proof,
        proofType: String(proof.proofType ?? proof.type ?? 'unknown'),
        verdict: serializeProofVerdict(proof),
        reasons: Array.isArray(proof.reasons)
            ? proof.reasons
            : Array.isArray(proof.contradictions)
                ? proof.contradictions
                : Array.isArray(proof.evidence)
                    ? proof.evidence
                    : [],
    };
}
export function serializeProofList(proofs) {
    return Array.isArray(proofs) ? proofs.map((proof) => serializeProof(proof)) : [];
}
export function serializeSimulationProof(proof) {
    if (!proof || typeof proof !== 'object') {
        return proof ?? null;
    }
    return serializeProof({
        ...proof,
        proofType: proof.proofType ?? 'simulation',
    });
}
