API Overview¶
Core Methods¶
start(file, theorem)
: Begin a proof sessionrun(state, command)
: Execute tactics or commandsgoals(state)
: Get current proof goalspremises(state)
: Get available premises/lemmas
Advanced Features¶
ast(state, text)
: Parse command to ASTast_at_pos(file, line, char)
: Get AST at file positionget_state_at_pos(file, line, char)
: Get proof state at positionget_root_state(file)
: Get initial document statestate_equal(st1, st2, kind)
: Compare proof statesstate_hash(state)
: Get state hashtoc(file)
: Get table of contents
Working with Feedback¶
All commands return states with feedback containing Rocq messages:
state = client.run(state, "Search nat.")
for level, message in state.feedback:
print(f"Level {level}: {message}")