MCPcopy Create free account
hub / github.com/algorithmicsuperintelligence/optillm / verify_key_insights

Function verify_key_insights

scripts/imo25_reference.py:224–292  ·  view source on GitHub ↗

Check for problem-specific key insights that should appear in correct solutions

(problem_id: int, solution: str)

Source from the content-addressed store, hash-verified

222 return result
223
224def verify_key_insights(problem_id: int, solution: str) -> Dict[str, Any]:
225 """
226 Check for problem-specific key insights that should appear in correct solutions
227 """
228 problem_data = next((p for p in IMO_2025_PROBLEMS if p["id"] == problem_id), None)
229 if not problem_data:
230 return {"insight_score": 0.0, "insights_found": [], "insights_missing": []}
231
232 key_insights = problem_data["key_insights"]
233 solution_lower = solution.lower()
234
235 insights_found = []
236 insights_missing = []
237
238 # Define keywords for each insight type
239 insight_keywords = {
240 # Problem 1
241 "reduction_principle": ["reduction", "reduce", "specific case"],
242 "structural_lemma": ["structural", "lemma", "vertical", "horizontal", "diagonal"],
243 "c_k_analysis": ["c(k)", "assertion", "pk can be covered"],
244 "sunny_line_covering": ["sunny", "shady", "parallel"],
245
246 # Problem 2
247 "excenter_identification": ["excenter", "external", "angle bisector"],
248 "auxiliary_point_v": ["auxiliary", "point v", "parallelogram"],
249 "orthocenter_tangency": ["orthocenter", "tangent", "perpendicular"],
250 "circumcircle_properties": ["circumcircle", "circumcenter"],
251
252 # Problem 3
253 "classification_lemma": ["classification", "lemma", "set s"],
254 "set_s_analysis": ["s = p", "s = ∅", "s = {2}", "infinite", "finite"],
255 "upper_bound_proof": ["upper bound", "f(n) ≤", "c ≤ 4"],
256 "construction_example": ["construction", "example", "g(n)"],
257
258 # Problem 4
259 "regime_analysis": ["regime", "growth", "boost", "fixed point"],
260 "evolution_dynamics": ["evolution", "sequence", "a_{n+1}"],
261 "divisibility_constraints": ["6|an", "divisible", "v2", "v3"],
262 "fixed_point_analysis": ["fixed point", "stable", "r(n) = 1"],
263
264 # Problem 5
265 "budget_analysis": ["budget", "ck", "evolution"],
266 "critical_threshold": ["threshold", "1/√2", "critical"],
267 "strategy_construction": ["strategy", "alice", "bazza"],
268 "drawing_strategies": ["draw", "game continues", "forever"],
269
270 # Problem 6
271 "tiling_constraints": ["tile", "rectangular", "cover"],
272 "row_column_requirements": ["row", "column", "exactly one"],
273 "optimization_bounds": ["minimum", "lower bound", "upper bound"],
274 "construction_proof": ["construction", "proof", "achieve"]
275 }
276
277 for insight in key_insights:
278 if insight in insight_keywords:
279 keywords = insight_keywords[insight]
280 if any(keyword in solution_lower for keyword in keywords):
281 insights_found.append(insight)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected