litex/execute/
exec_prove_stmt.rs1use crate::prelude::*;
2
3impl Runtime {
4 pub fn exec_prove_stmt(&mut self, stmt: &ProveStmt) -> Result<StmtResult, RuntimeError> {
5 let inside_results = self.run_in_local_env(|rt| {
6 let mut inside_results: Vec<StmtResult> = Vec::new();
7 for proof_stmt in &stmt.proof {
8 let exec_stmt_result = rt.exec_stmt(proof_stmt);
9 match exec_stmt_result {
10 Ok(result) => inside_results.push(result),
11 Err(statement_error) => {
12 return Err(short_exec_error(
13 stmt.clone().into(),
14 proof_stmt.to_string(),
15 Some(statement_error),
16 std::mem::take(&mut inside_results),
17 ));
18 }
19 }
20 }
21 Ok(inside_results)
22 });
23
24 match inside_results {
25 Ok(inside_results) => Ok(NonFactualStmtSuccess::new(
26 stmt.clone().into(),
27 InferResult::new(),
28 inside_results,
29 )
30 .into()),
31 Err(inside_results_error) => Err(inside_results_error),
32 }
33 }
34}