Spaces:
Sleeping
Sleeping
Commit History
-
Add MiniF2F benchmark harness and improve proof agent robustness
p4r5kpftnp-cmd +1: Claude Sonnet 4.6- scripts/benchmark.py: new benchmark runner against MiniF2F-valid (244 problems); reports pass@k for k=1..max_retries, avg attempts-to-solve, avg wall-clock time, and writes a per-problem CSV for ablation analysis - langgraph_agent.py: track solved_at_attempt in ProofState; expose solve_file_detailed() returning {success, solved_at_attempt, total_attempts}; add _count_theorem_blocks() guard that rejects LLM responses that silently drop theorem statements (false-success bug) - rag_chain.py: rewrite system prompt with tactic reference, common mistakes section, and seven few-shot examples; escape curly braces in Lean implicit-arg syntax so LangChain doesn't treat them as template variables (KeyError crash) - problems/lecture{4-7}_problems.lean: verified Lean 4 solutions for 11 problems drawn from course lecture notes (Lectures 4-7) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>8c51ce7
-
Add LangChain/LangGraph RAG pipeline for retrieval-augmented proof generation
p4r5kpftnp-cmd +1: Claude Sonnet 4.6- src/mathlib_corpus.py: walks Mathlib4 .lean source files and extracts theorem/lemma/def declarations as LangChain Documents - src/retriever.py: MathLibRetriever — FAISS + BM25 hybrid retrieval via EnsembleRetriever (60/40), reranked with CrossEncoder; index persisted to data/mathlib_index/ for reuse across runs - src/rag_chain.py: RAGProofChain — LangChain LCEL chain (ChatPromptTemplate | OllamaLLM | StrOutputParser) that injects retrieved lemma context into each proof-generation call - src/langgraph_agent.py: LangGraphAgent — replaces the plain Python retry loop with a proper state machine (verify → retrieve → generate → verify); exposes the same solve_file() API - src/proof_agent.py: thin backward-compatible wrapper around LangGraphAgent - scripts/build_index.py: one-time offline script to build and save the FAISS index from Mathlib4 source - scripts/run_agent.py: updated to use LangGraphAgent directly - requirements.txt: add faiss-cpu, rank-bm25, sentence-transform…3ac681e