Skip to content

Commit

Permalink
Update older todos.
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrej33 committed Dec 12, 2024
1 parent 7139300 commit 83fcb41
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 24 deletions.
5 changes: 2 additions & 3 deletions src-tauri/src/algorithms/eval_dynamic/_trap_spaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub fn colors_where_essential_traps(
graph: &SymbolicAsyncGraph,
ctx: &SymbolicSpaceContext,
) -> GraphColors {
// TODO: before computing Essential traps, restrict the colors to only the ones where all observations are trap spaces
// TODO: could be optimized by restricting the colors to subset where all observations are trap spaces

// compute essential spaces
let essential_traps = compute_essential_trap_spaces(graph, ctx, None);
Expand Down Expand Up @@ -65,8 +65,7 @@ pub fn colors_where_minimal_traps(
graph: &SymbolicAsyncGraph,
ctx: &SymbolicSpaceContext,
) -> GraphColors {
// TODO: before computing Minimal traps, restrict the colors to only the ones where all observations are trap spaces
// TODO: maybe also restrict the colors to only the ones where the observations are essential trap spaces
// TODO: could be optimized by restricting the colors to subset where all observations are trap spaces

// compute minimal spaces
let minimal_traps = compute_minimal_trap_spaces(graph, ctx, None);
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/algorithms/eval_dynamic/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub fn eval_dyn_prop(
}
ProcessedDynProp::ProcessedAttrCount(prop) => {
// custom implementation (can be made more efficient if needed)
// todo: optimize - first just compute fixed-points and get colors where N_fp <= MAX_ATTR
// TODO: could be optimized by first computing fixed-points and removing colors where N_fp > MAX_ATTR

// compute full attractors (on remaining colors) and get colors with correct n. of attrs
let colors_per_num_attrs: Vec<GraphColors> = sort_colors_by_attr_num(graph);
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/src/algorithms/eval_dynamic/processed_props.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ pub fn process_dynamic_props(sketch: &Sketch) -> Result<Vec<ProcessedDynProp>, S
}
// encode fixed-points HCTL formula
DynPropertyType::ExistsFixedPoint(prop) => {
// TODO: maybe encode as multiple formulae if we have more than one observation (instead of a conjunction)?
// TODO: if we have whole dataset, instead of using conjunction, try encoding as multiple properties
let dataset_id = prop.dataset.clone().unwrap();
let dataset = sketch.observations.get_dataset(&dataset_id)?;
let formula = encode_dataset_hctl_str(
Expand All @@ -149,7 +149,7 @@ pub fn process_dynamic_props(sketch: &Sketch) -> Result<Vec<ProcessedDynProp>, S
}
// encode attractors with HCTL formula
DynPropertyType::HasAttractor(prop) => {
// TODO: maybe encode as multiple formulae if we have more than one observation (instead of a conjunction)?
// TODO: if we have whole dataset, instead of using conjunction, try encoding as multiple properties
let dataset_id = prop.dataset.clone().unwrap();
let dataset = sketch.observations.get_dataset(&dataset_id)?;
let formula = encode_dataset_hctl_str(
Expand Down
2 changes: 0 additions & 2 deletions src-tauri/src/algorithms/fo_logic/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,6 @@ pub fn is_update_fn_symbol(fn_symbol: &str) -> bool {
}

/// Compute a valid name for an "anonymous update function" of the corresponding variable.
///
/// TODO: currently does not double check if there are collisions with existing params
pub fn get_implicit_function_name(variable_name: &str) -> String {
format!("f_{}", variable_name)
}
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/sketchbook/_sketch/_impl_consistency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl Sketch {
message += "> ISSUE: There must be at least one variable.\n";
}

// TODO: in future, we can also add a check whether update fns match regulation monotonicity
// TODO: in future, we can also add a check if update fn expressions match regulation properties

(consitent, message)
}
Expand Down
1 change: 0 additions & 1 deletion src-tauri/src/sketchbook/_sketch/_impl_import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ impl Sketch {
let property = prop_data.to_property()?;

// ignore automatically generated static props as they were added before
// todo: this can loose some info as standard AEON format does not cover all regulation types
match prop_data.variant {
StatPropertyTypeData::RegulationEssential(..)
| StatPropertyTypeData::RegulationMonotonic(..) => {}
Expand Down
3 changes: 1 addition & 2 deletions src-tauri/src/sketchbook/_sketch/_impl_session_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ impl SessionState for Sketch {
let mut contents = String::new();
file.read_to_string(&mut contents)?;

// parse the AEON format
// TODO: aeon format currently does not support template properties and datasets
// parse AEON format (extended with custom annotations)
let new_sketch = Sketch::from_aeon(&contents)?;
self.modify_from_sketch(&new_sketch);

Expand Down
14 changes: 7 additions & 7 deletions src-tauri/src/sketchbook/bn_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use biodivine_lib_param_bn::Monotonicity as Lib_Pbn_Monotonicity;

/// Utility to convert monotonicity enum used by `lib_param_bn` into the type used here.
///
/// TODO: note that `lib-param-bn` currently cannot express `Dual` variant of `Monotonicity`.
/// IMPORTANT: note that `lib-param-bn` currently cannot express `Dual` variant of `Monotonicity`.
pub fn sign_from_monotonicity(monotonicity: Option<Lib_Pbn_Monotonicity>) -> Monotonicity {
match monotonicity {
Some(m) => match m {
Expand All @@ -14,23 +14,23 @@ pub fn sign_from_monotonicity(monotonicity: Option<Lib_Pbn_Monotonicity>) -> Mon
}
}

/// Utility to convert regulation sign from enum type used in this crate into the type used in `lib_param_bn`.
/// Utility to convert regulation sign from enum type used in this crate into the type used
/// in `lib_param_bn`.
///
/// TODO: note that `lib-param-bn` currently cannot express `Dual` variant of `Monotonicity`. We convert it
/// to `Unknown` instead.
/// IMPORTANT: note that `lib-param-bn` currently cannot express `Dual` variant of `Monotonicity`.
/// We convert it to `Unknown` instead.
pub fn sign_to_monotonicity(regulation_sign: &Monotonicity) -> Option<Lib_Pbn_Monotonicity> {
match regulation_sign {
Monotonicity::Activation => Some(Lib_Pbn_Monotonicity::Activation),
Monotonicity::Inhibition => Some(Lib_Pbn_Monotonicity::Inhibition),
Monotonicity::Unknown => None,
// TODO: maybe put "unimplemented" here?
Monotonicity::Dual => None,
}
}

/// Utility method to convert `Essentiality` from boolean.
///
/// TODO: note that `lib-param-bn` currently cannot distinguish between `False` and `Unknown`
/// IMPORTANT: note that `lib-param-bn` currently cannot distinguish between `False` and `Unknown`
/// variants of `Essentiality`. In general, these are both represented by "false" in `lib-param-bn`.
pub fn essentiality_from_bool(essentiality: bool) -> Essentiality {
match essentiality {
Expand All @@ -42,7 +42,7 @@ pub fn essentiality_from_bool(essentiality: bool) -> Essentiality {

/// Utility method to convert `Essentiality` into boolean.
///
/// TODO: note that `lib-param-bn` currently cannot distinguish between `False` and `Unknown`
/// IMPORTANT: note that `lib-param-bn` currently cannot distinguish between `False` and `Unknown`
/// variants of `Essentiality`. In general, these are both represented by "false" in `lib-param-bn`.
pub fn essentiality_to_bool(essentiality: Essentiality) -> bool {
match essentiality {
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/sketchbook/layout/_node_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::fmt::{Display, Error, Formatter};
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct LayoutNode {
position: NodePosition,
// TODO: add other data in future (visibility, colour, shape, ...)
// TODO: other data layout data will be here in future (visibility, colour, shape, ...)
}

impl LayoutNode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ impl ModelState {
}

// substitute id for this uninterpreted fn in all uninterpreted functions' expressions
// TODO: this is a bit inefficient
// TODO: there may be more efficient way to do this
for fn_id in self.uninterpreted_fns.clone().keys() {
let uninterpreted_fn = self.uninterpreted_fns.remove(fn_id).unwrap();
let new_uninterpreted_fn = UninterpretedFn::with_substituted_fn_symbol(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ impl ModelState {
self.remove_layout(&layout_id)?;
let state_change = mk_model_state_change(&["layout", "remove"], &layout_data);

// TODO: make this reversible in the future?
Ok(Consumed::Irreversible {
state_change,
reset: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ impl ObservationManager {
let new_dataset_data = DatasetData::from_dataset(&dataset_id, new_dataset);
let state_change = mk_obs_state_change(&["remove_var"], &new_dataset_data);

// TODO: make this potentially reversible?
// TODO: we can make this potentially into reversible event
Ok(Consumed::Irreversible {
state_change,
reset: true,
Expand All @@ -307,7 +307,7 @@ impl ObservationManager {
let new_dataset_data = DatasetData::from_dataset(&dataset_id, new_dataset);
let state_change = mk_obs_state_change(&["add_var"], &new_dataset_data);

// TODO: make this potentially reversible?
// TODO: we can make this potentially into reversible event
Ok(Consumed::Irreversible {
state_change,
reset: true,
Expand Down

0 comments on commit 83fcb41

Please sign in to comment.