True when `expr` contains a `LetRec` AST node.
(self: &MirRelationExpr)
| 2012 | impl MirRelationExpr { |
| 2013 | /// True when `expr` contains a `LetRec` AST node. |
| 2014 | pub fn is_recursive(self: &MirRelationExpr) -> bool { |
| 2015 | let mut worklist = vec![self]; |
| 2016 | while let Some(expr) = worklist.pop() { |
| 2017 | if let MirRelationExpr::LetRec { .. } = expr { |
| 2018 | return true; |
| 2019 | } |
| 2020 | worklist.extend(expr.children()); |
| 2021 | } |
| 2022 | false |
| 2023 | } |
| 2024 | |
| 2025 | /// Return the number of sub-expressions in the tree (including self). |
| 2026 | pub fn size(&self) -> usize { |
no test coverage detected