litex/execute/
exec_stmt.rs1use crate::prelude::*;
2
3impl Runtime {
4 pub fn exec_stmt(&mut self, stmt: &Stmt) -> Result<StmtResult, RuntimeError> {
5 match stmt {
6 Stmt::DefLetStmt(d) => self.exec_let_stmt(d),
7 Stmt::DefPropStmt(d) => self.exec_def_prop_stmt(d),
8 Stmt::DefAbstractPropStmt(d) => self.exec_def_abstract_prop_stmt(d),
9 Stmt::HaveObjInNonemptySetStmt(d) => {
10 self.exec_have_obj_in_nonempty_set_or_param_type_stmt(d)
11 }
12 Stmt::HaveObjEqualStmt(d) => self.exec_have_obj_equal_stmt(d),
13 Stmt::HaveByExistStmt(d) => self.exec_have_exist_obj_stmt(d),
14 Stmt::HaveFnEqualStmt(d) => self.exec_have_fn_equal_stmt(d),
15 Stmt::HaveFnEqualCaseByCaseStmt(d) => self.exec_have_fn_equal_case_by_case_stmt(d),
16 Stmt::HaveFnByInducStmt(d) => self.exec_have_fn_by_induc_stmt(d),
17 Stmt::DefFamilyStmt(d) => self.exec_def_family_stmt(d),
18 Stmt::DefAlgoStmt(d) => self.exec_def_algo_stmt(d),
19 Stmt::KnowStmt(know_stmt) => self.exec_know_stmt(know_stmt),
20 Stmt::Fact(fact) => self.exec_fact(fact),
21 Stmt::ClaimStmt(s) => self.exec_claim_stmt(s),
22 Stmt::ProveStmt(s) => self.exec_prove_stmt(s),
23 Stmt::ImportStmt(s) => self.exec_import_stmt(s),
24 Stmt::DoNothingStmt(s) => self.exec_do_nothing_stmt(s),
25 Stmt::ClearStmt(s) => self.exec_clear_stmt(s),
26 Stmt::RunFileStmt(s) => self.exec_run_file_stmt(s),
27 Stmt::EvalStmt(s) => self.exec_eval_stmt(s),
28 Stmt::WitnessExistFact(s) => self.exec_witness_exist_fact(s),
29 Stmt::WitnessNonemptySet(s) => self.exec_witness_nonempty_set(s),
30 Stmt::ByCasesStmt(s) => self.exec_by_cases_stmt(s),
31 Stmt::ByContraStmt(s) => self.exec_by_contra_stmt(s),
32 Stmt::ByEnumerateFiniteSetStmt(s) => self.exec_by_enumerate_finite_set_stmt(s),
33 Stmt::ByInducStmt(s) => self.exec_by_induc_stmt(s),
34 Stmt::ByForStmt(s) => self.exec_by_for_stmt(s),
35 Stmt::ByExtensionStmt(s) => self.exec_by_extension_stmt(s),
36 Stmt::ByFnStmt(s) => self.exec_by_fn_stmt(s),
37 Stmt::ByFamilyStmt(s) => self.exec_by_family_stmt(s),
38 Stmt::ByTuple(s) => self.exec_by_tuple_stmt(s),
39 Stmt::ByFnSetStmt(s) => self.exec_by_fn_set_stmt(s),
40 Stmt::ByEnumerateClosedRangeStmt(s) => self.exec_by_enumerate_closed_range_stmt(s),
41 }
42 }
43
44 pub fn stmt_unsupported(stmt: Stmt) -> Result<StmtResult, RuntimeError> {
45 Err(short_exec_error(
46 stmt,
47 "unimplemented".to_string(),
48 None,
49 vec![],
50 ))
51 }
52}