Skip to content

Commit 4e73582

Browse files
authored
feat(CI): distinguish formally solved Erdős problem status (google-deepmind#2299)
Map 'solved (Lean)', 'proved (Lean)', 'disproved (Lean)' to 'formally solved' as a distinct category from 'solved', and tags the issue "formalisation exists elsewhere".
1 parent 6fc02d5 commit 4e73582

File tree

2 files changed

+27
-14
lines changed

2 files changed

+27
-14
lines changed

.github/workflows/check_erdos_status.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Check Erdos problem statuses
22

33
on:
44
schedule:
5-
- cron: '37 * * * *' # once an hour, 37 min past the hour
5+
- cron: '0 6 * * *' # Daily at 6 AM UTC
66
workflow_dispatch: # Allow manual trigger
77

88
jobs:

scripts/check_erdos_status.py

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,18 @@
4141
OPEN_STATES = {"open", "falsifiable", "verifiable"}
4242
SOLVED_STATES = {
4343
"solved",
44-
"solved (Lean)",
4544
"proved",
4645
"disproved",
47-
"proved (Lean)",
48-
"disproved (Lean)",
4946
"not provable",
5047
"not disprovable",
5148
"independent",
5249
"decidable",
5350
}
51+
FORMALLY_SOLVED_STATES = {
52+
"solved (Lean)",
53+
"proved (Lean)",
54+
"disproved (Lean)",
55+
}
5456

5557

5658
def fetch_yaml():
@@ -59,20 +61,31 @@ def fetch_yaml():
5961

6062

6163
def yaml_status_to_category(state):
62-
"""Map a YAML status.state value to 'open', 'solved', or None.
64+
"""Map a YAML status.state value to 'open', 'solved', 'formally solved', or None.
6365
6466
Returns None for unrecognized states.
6567
"""
6668
if state in OPEN_STATES:
6769
return "open"
70+
if state in FORMALLY_SOLVED_STATES:
71+
return "formally solved"
6872
if state in SOLVED_STATES:
6973
return "solved"
7074
print(f"WARNING: unrecognized YAML status state: {state!r}", file=sys.stderr)
7175
return None # unrecognized — skip comparison
7276

7377

78+
def lean_category(cat):
79+
"""Normalize a captured category string to 'open', 'solved', or 'formally solved'."""
80+
if cat == "open":
81+
return "open"
82+
if cat.startswith("formally solved"):
83+
return "formally solved"
84+
return "solved"
85+
86+
7487
def scan_lean_files():
75-
"""Return dict mapping problem number (str) -> 'open' or 'solved'."""
88+
"""Return dict mapping problem number (str) -> 'open', 'solved', or 'formally solved'."""
7689
result = {}
7790
for fname in os.listdir(ERDOS_DIR):
7891
if not fname.endswith(".lean"):
@@ -86,8 +99,7 @@ def scan_lean_files():
8699
# Find the main theorem's category (first match for this problem number)
87100
for m in CATEGORY_THEN_THEOREM.finditer(content):
88101
if m.group(2) == file_number:
89-
cat = m.group(1)
90-
result[file_number] = "open" if cat == "open" else "solved"
102+
result[file_number] = lean_category(m.group(1))
91103
break
92104
return result
93105

@@ -159,12 +171,13 @@ def create_issues(mismatches):
159171
f"Please verify and update the `@[category research ...]` "
160172
f"annotation if appropriate."
161173
)
162-
subprocess.run(
163-
["gh", "issue", "create",
164-
"--title", title,
165-
"--body", body,
166-
"--label", "erdos-status-sync"],
167-
)
174+
labels = ["erdos-status-sync"]
175+
if m["yaml_status"] == "formally solved":
176+
labels.append("formalisation exists elsewhere")
177+
cmd = ["gh", "issue", "create", "--title", title, "--body", body]
178+
for label in labels:
179+
cmd.extend(["--label", label])
180+
subprocess.run(cmd)
168181

169182

170183
def main():

0 commit comments

Comments
 (0)