# ------------------------------------------------------------------
# File generated by save_this_cell
# Notebook: RepoMan_pyprover9.ipynb
# Saved: 2026-03-07 16:04:16
# ------------------------------------------------------------------


import sys
import platform

def prover9_executable(verbose=True):
    system = sys.platform
    arch = platform.architecture()[0]   # '64bit' or '32bit'

    if system.startswith("linux"):
        if arch == "64bit":
            if verbose: print("Detected platform: Linux 64-bit")
            exe = "prover9-linux-elf-64"
        else:
            if verbose: print("Detected platform: Linux 32-bit")
            exe = "prover9-linux-elf-32"

    elif system == "darwin":
        if verbose: print("Detected platform: MacOS")
        exe = "prover9-MacOS-64"

    elif system in ("win32", "cygwin"):
        plat_str = {"win32":"Windows", "cygwin":"Cygwin"}[system]
        if verbose: print( "Detected platform:", plat_str)
        exe = "prover9-windows-32.exe"

    else:
        if verbose: print("Detected unsupported platform:", system)
        raise RuntimeError(f"Unsupported platform: {system}")

    if verbose:
        print(f"Selected executable: {exe}")

    return exe
