(batch_id, item, batch_answers, context, autoformalization,
repl_path, lean_env_path, session_timeout, expect_timeout)
| 149 | |
| 150 | # Process a proof batch |
| 151 | def process_batch(batch_id, item, batch_answers, context, autoformalization, |
| 152 | repl_path, lean_env_path, session_timeout, expect_timeout): |
| 153 | # Initialize interactive thread |
| 154 | thread = InteractiveThread( |
| 155 | batch_id, |
| 156 | repl_path=repl_path, |
| 157 | lean_env_path=lean_env_path, |
| 158 | initial_context=context, |
| 159 | timeout=session_timeout, |
| 160 | expect_timeout=expect_timeout |
| 161 | ) |
| 162 | thread.start() |
| 163 | thread.init_complete.wait() # Wait for initialization to complete |
| 164 | |
| 165 | results = [] |
| 166 | try: |
| 167 | for answer in batch_answers: |
| 168 | # Verify each answer in the batch |
| 169 | verified_answer, answer_bool = process_answer(item, answer, autoformalization, thread) |
| 170 | results.append({"answer": verified_answer, "answer_bool": answer_bool}) # Collect results |
| 171 | finally: |
| 172 | thread.stop() |
| 173 | thread.join() |
| 174 | |
| 175 | return results |
| 176 | |
| 177 | def process_answer(item, answer, autoformalization, thread): |
| 178 | answer = answer.split("```")[0] |
nothing calls this directly
no test coverage detected