mod tests; use crate::ast::Node; // fn cancel_double_negation(ast: Node) { // let mut new_ast = ast.clone(); // fn recursion(ast: &mut Node, node_count: usize) { // match ast { // Node::Unary { operator: _, operand } => { // recursion(&mut *operand, node_count + 1); // }, // Node::Binary { operator: _, lhs, rhs } => { // recursion(&mut *lhs, node_count + 1); // recursion(&mut *rhs, node_count + 1); // }, // Node::Leaf(c) => (), // } // } // recursion(&mut new_ast, 0); // new_ast // } fn negation_normal_form(formula: &str) -> String { let ast = Node::::parse_formula(formula); Node::::ast_to_formula(ast) }