public boolean call(Builtin builtin, Node n1, Node n2) { return builtin.bodyCall(new Node[] {n1, n2}, 2, new DummyRuleContext()); }
public boolean call(Builtin builtin, Node n1, Node n2) { return builtin.bodyCall(new Node[] {n1, n2}, 2, new DummyRuleContext()); }
/** * Execute the given built in as a body clause. * @param context an execution context giving access to other relevant data * @return true if the functor has an implementation and that implementation returns true when evaluated */ public boolean evalAsBodyClause(RuleContext context) { if (getImplementor() == null) { logger.warn("Invoking undefined functor " + getName() + " in " + context.getRule().toShortString()); return false; } return implementor.bodyCall(getBoundArgs(context.getEnv()), args.length, context); }
/** * Execute the given built in as a body clause. * @param context an execution context giving access to other relevant data * @return true if the functor has an implementation and that implementation returns true when evaluated */ public boolean evalAsBodyClause(RuleContext context) { if (getImplementor() == null) { logger.warn("Invoking undefined functor " + getName() + " in " + context.getRule().toShortString()); return false; } return implementor.bodyCall(getBoundArgs(context.getEnv()), args.length, context); }
/** * Execute the given built in as a body clause, only if it is side-effect-free. * @param context an execution context giving access to other relevant data * @return true if the functor has an implementation and that implementation returns true when evaluated */ public boolean safeEvalAsBodyClause(RuleContext context) { if (getImplementor() == null) { logger.warn("Invoking undefined functor " + getName() + " in " + context.getRule().toShortString()); return false; } if (implementor.isSafe()) { return implementor.bodyCall(getBoundArgs(context.getEnv()), args.length, context); } else { return false; } }
/** * Execute the given built in as a body clause, only if it is side-effect-free. * @param context an execution context giving access to other relevant data * @return true if the functor has an implementation and that implementation returns true when evaluated */ public boolean safeEvalAsBodyClause(RuleContext context) { if (getImplementor() == null) { logger.warn("Invoking undefined functor " + getName() + " in " + context.getRule().toShortString()); return false; } if (implementor.isSafe()) { return implementor.bodyCall(getBoundArgs(context.getEnv()), args.length, context); } else { return false; } }
if (!builtin.bodyCall(argVars, code[pc++], context)) { if (traceOn) logger.info("FAIL " + clause + ", due to " + builtin.getName()); continue main;
if (!builtin.bodyCall(argVars, code[pc++], context)) { if (traceOn) logger.info("FAIL " + clause + ", due to " + builtin.getName()); continue main;