public static bool setRule(RPN.Node node) { return(node.IsFunction("list") || node.IsFunction("matrix") || node.IsOperator()); }
public static bool singleElementRunnable(RPN.Node node) { return(!node.IsOperator() && node.Children.Count == 1); }
//{a,b,c,d}-f /** * AST Simplified Infix : {a,b,c,d}-f * - [7 | 2 | Operator | True | ea8e4abd68164eeb2055ac51b1fe75c6] * ├─f [6 | 0 | Variable | False | 8fa14cdd754f91cc6554c9e71929cce7] * └─list [5 | 4 | Function | False | 6e428e7310356df8d8351466442eb6d1] * ├─d [4 | 0 | Variable | False | 8277e0910d750195b448797616e091ad] * ├─c [3 | 0 | Variable | False | 4a8a08f09d37b73795649038408b5f33] * ├─b [2 | 0 | Variable | False | 92eb5ffee6ae2fec3ad71c777531578f] * └─a [1 | 0 | Variable | False | 0cc175b9c0f1b6a831c399e269772661] */ public static bool VectorFrontScalarBackRunnable(RPN.Node node) { return(node.IsOperator() && node.Token.Arguments == 2 && node[0].IsScalar() && node[1].IsFunction("list")); }
public static bool ZeroFactorialRunnable(RPN.Node node) { return(node.IsOperator("!") && (node[0].IsNumber(0) || node[0].IsNumber(1))); }