#!/usr/bin/env python3 """Reproduce the manuscript's exact checks in a disposable copy. Use Python 3.10+ with its standard library. Saved certificates are not changed. This checks finite arithmetic and enumerations, not the mathematical reductions or external theorems. Full process output is saved next to this runner. """ from pathlib import Path import hashlib import json import shutil import subprocess import sys import tempfile import time HERE = Path(__file__).resolve().parent SOURCE = HERE / 'research' / 'c11-d6' def main(): checks = json.loads((HERE / 'checks.json').read_text()) records = [] with tempfile.TemporaryDirectory(prefix='liu-degree-six-checks-') as temporary: root = Path(temporary) / 'research' / 'c11-d6' shutil.copytree(SOURCE, root) for relative in checks: original = SOURCE / relative start = time.monotonic() result = subprocess.run([sys.executable, str(root / relative)], cwd=Path(temporary), capture_output=True, text=True) records.append(dict(script=relative, sha256=hashlib.sha256(original.read_bytes()).hexdigest(), returncode=result.returncode, seconds=round(time.monotonic()-start, 3), stdout=result.stdout, stderr=result.stderr)) print(('PASS' if result.returncode == 0 else 'FAIL') + ' ' + relative, flush=True) passed = all(item['returncode'] == 0 for item in records) report = dict(status='PASS' if passed else 'FAIL', interpreter=sys.version, scope='Exact finite calculations; external theorems and graph reductions are mathematical inputs.', checks=records) (HERE / 'verification-latest-run.json').write_text(json.dumps(report, indent=2)+'\n') print(report['status'] + ': ' + str(len(checks)) + ' exact checks', flush=True) return 0 if passed else 1 if __name__ == '__main__': raise SystemExit(main())