IsReducerFunction returns true if sym is a reducer function.
(sym ast.FunctionSym)
| 202 | |
| 203 | // IsReducerFunction returns true if sym is a reducer function. |
| 204 | func IsReducerFunction(sym ast.FunctionSym) bool { |
| 205 | if _, ok := ReducerFunctions[sym]; ok { |
| 206 | return true |
| 207 | } |
| 208 | if _, ok := ReducerFunctions[ast.FunctionSym{sym.Symbol, -1}]; ok { |
| 209 | return true // variable arity |
| 210 | } |
| 211 | return false |
| 212 | } |
| 213 | |
| 214 | // Decide evaluates an atom of a built-in predicate. The atom must no longer contain any |
| 215 | // apply-expressions or variables. |