Skip to content

Commit

Permalink
WIP: compose
Browse files Browse the repository at this point in the history
  • Loading branch information
shnarazk committed Feb 3, 2024
1 parent e57a75d commit 62194ce
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/bdd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,19 @@ impl ReducedDecisionDiagram for BDD<Node> {
applied.reduce();
applied
}
/// return a new diagram by composing this and other
fn compose(&self, other: &Self, _at: usize) -> Self {
let v1 = self.graph.clone();
let v2 = other.graph.clone();
BDD {
graph: compose_aux(&v1, &v1, &v2),
..Default::default()
}
}
}

fn compose_aux(_low: &Node, _high: &Node, _other: &Node) -> Node {
unimplemented!()
}

#[cfg(test)]
Expand Down
2 changes: 2 additions & 0 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ pub trait ReducedDecisionDiagram {
fn reduce(&mut self);
/// return a new graph generated by apply `op` to this and the other graph
fn apply(&self, op: Box<dyn Fn(bool, bool) -> bool>, unit: bool, _other: &Self) -> Self;
/// compose two diagrams
fn compose(&self, _other: &Self, at: usize) -> Self;
}
5 changes: 4 additions & 1 deletion src/zdd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ impl ReducedDecisionDiagram for ZDD<Node> {
self.graph = from_index[&to_index[root]].clone();
}
fn apply(&self, _op: Box<dyn Fn(bool, bool) -> bool>, _unit: bool, _other: &Self) -> Self {
todo!()
unimplemented!()
}
fn compose(&self, _other: &Self, _at: usize) -> Self {
unimplemented!()
}
}

0 comments on commit 62194ce

Please sign in to comment.