From 2be243959272c522aed5dcbd4c392f95233c57b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Chud=C3=AD=C4=8Dek?= Date: Sun, 14 Jan 2024 01:27:26 +0100 Subject: [PATCH] refactor: moved unprocessed_variable_update_function where it belongs --- src/lib.rs | 1 - src/system.rs | 28 ------------------- src/update/mod.rs | 1 + .../unprocessed_variable_update_function.rs | 25 +++++++++++++++++ src/update/update_fn.rs | 4 +-- src/xml_parsing/variable_update_fn_parser.rs | 2 +- 6 files changed, 29 insertions(+), 32 deletions(-) delete mode 100644 src/system.rs create mode 100644 src/update/unprocessed_variable_update_function.rs diff --git a/src/lib.rs b/src/lib.rs index f9229eb..8d0868b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,6 @@ pub mod test_utils; // TODO: // to have it accessible from outside binaries. mod expression_components; mod symbolic_domains; -mod system; mod update; mod utils; mod xml_parsing; diff --git a/src/system.rs b/src/system.rs deleted file mode 100644 index 9d4f323..0000000 --- a/src/system.rs +++ /dev/null @@ -1,28 +0,0 @@ -// todo move where it belongs -pub mod variable_update_function { - use crate::expression_components::expression::Expression; - - #[derive(Debug)] - pub struct UnprocessedVariableUpdateFn { - pub input_vars_names: Vec, - pub target_var_name: String, - pub terms: Vec<(T, Expression)>, - pub default: T, - } - - impl UnprocessedVariableUpdateFn { - pub fn new( - input_vars_names: Vec, - target_var_name: String, - terms: Vec<(T, Expression)>, - default: T, - ) -> Self { - Self { - input_vars_names, - target_var_name, - terms, - default, - } - } - } -} diff --git a/src/update/mod.rs b/src/update/mod.rs index 3b289d3..0aaf2ab 100644 --- a/src/update/mod.rs +++ b/src/update/mod.rs @@ -1 +1,2 @@ +pub mod unprocessed_variable_update_function; pub mod update_fn; diff --git a/src/update/unprocessed_variable_update_function.rs b/src/update/unprocessed_variable_update_function.rs new file mode 100644 index 0000000..f0431f4 --- /dev/null +++ b/src/update/unprocessed_variable_update_function.rs @@ -0,0 +1,25 @@ +use crate::expression_components::expression::Expression; + +#[derive(Debug)] +pub struct UnprocessedVariableUpdateFn { + pub input_vars_names: Vec, + pub target_var_name: String, + pub terms: Vec<(T, Expression)>, + pub default: T, +} + +impl UnprocessedVariableUpdateFn { + pub fn new( + input_vars_names: Vec, + target_var_name: String, + terms: Vec<(T, Expression)>, + default: T, + ) -> Self { + Self { + input_vars_names, + target_var_name, + terms, + default, + } + } +} diff --git a/src/update/update_fn.rs b/src/update/update_fn.rs index b1e89d8..e11776e 100644 --- a/src/update/update_fn.rs +++ b/src/update/update_fn.rs @@ -9,7 +9,7 @@ use biodivine_lib_bdd::{ use crate::{ expression_components::{expression::Expression, proposition::Proposition}, symbolic_domains::symbolic_domain::{SymbolicDomain, SymbolicDomainOrd}, - system::variable_update_function::UnprocessedVariableUpdateFn, + update::unprocessed_variable_update_function::UnprocessedVariableUpdateFn, }; use self::variable_update_fn::VariableUpdateFn; @@ -805,7 +805,7 @@ pub mod variable_update_fn { proposition::{ComparisonOperator as CmpOp, Proposition}, }, symbolic_domains::symbolic_domain::SymbolicDomainOrd, - system::variable_update_function::UnprocessedVariableUpdateFn as UnprocessedFn, + update::unprocessed_variable_update_function::UnprocessedVariableUpdateFn as UnprocessedFn, }; #[derive(Debug)] diff --git a/src/xml_parsing/variable_update_fn_parser.rs b/src/xml_parsing/variable_update_fn_parser.rs index c19c06e..7c83cf2 100644 --- a/src/xml_parsing/variable_update_fn_parser.rs +++ b/src/xml_parsing/variable_update_fn_parser.rs @@ -8,7 +8,7 @@ use xml::reader::XmlEvent; use crate::{ expression_components::expression::Expression, - system::variable_update_function::UnprocessedVariableUpdateFn, + update::unprocessed_variable_update_function::UnprocessedVariableUpdateFn, }; use super::{