fn no_neg_expr(expr: Expression) -> bool {
        match expr {
            Expression::Unary(Operator::Neg, _) => false,
            Expression::Unary(_, expr) => no_neg_expr(*expr),
            Expression::Binary(_, lhs, rhs) => no_neg_expr(*lhs) && no_neg_expr(*rhs),
            Expression::Variadic(_, exprs) => exprs.into_iter().all(no_neg_expr),
            _ => true,
        }
    }
//These all test if the various expression simplification functions work as intended basically.
These all test if the various expression simplification functions work as intended basically.
These all test if the various expression simplification functions work as intended basically .
fn no_neg_expr(expr: Expression) -> bool {
        match expr {
            Expression::Unary(Operator::Neg, _) => false,
            Expression::Unary(_, expr) => no_neg_expr(*expr),
            Expression::Binary(_, lhs, rhs) => no_neg_expr(*lhs) && no_neg_expr(*rhs),
            Expression::Variadic(_, exprs) => exprs.into_iter().all(no_neg_expr),
            _ => true,
        }
    }
fn no_neg_expr ( expr : Expression ) -> bool { match expr { Expression :: Unary ( Operator :: Neg , _ ) => false , Expression :: Unary ( _ , expr ) => no_neg_expr ( * expr ) , Expression :: Binary ( _ , lhs , rhs ) => no_neg_expr ( * lhs ) && no_neg_expr ( * rhs ) , Expression :: Variadic ( _ , exprs ) => exprs . into_iter ( ) . all ( no_neg_expr ) , _ => true , } }
These all test if the various expression simplification functions work as intended basically.
These all test if the various expression simplification functions work as intended basically .
expr
Expression
expr
Expression