/** * 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; } }
Builtin imp = f.getImplementor(); if (imp != null) { imp.headAction(f.getBoundArgs(env), f.getArgLength(), context); } else { throw new ReasonerException("Invoking undefined Functor " + f.getName() +" in " + rule.toShortString());
Builtin imp = f.getImplementor(); if (imp != null) { imp.headAction(f.getBoundArgs(env), f.getArgLength(), context); } else { throw new ReasonerException("Invoking undefined Functor " + f.getName() +" in " + rule.toShortString());
Builtin imp = f.getImplementor(); if (imp != null) { imp.headAction(f.getBoundArgs(env), f.getArgLength(), context); } else { throw new ReasonerException("Invoking undefined Functor " + f.getName() +" in " + rule.toShortString());
Builtin imp = f.getImplementor(); if (imp != null) { imp.headAction(f.getBoundArgs(env), f.getArgLength(), context); } else { throw new ReasonerException("Invoking undefined Functor " + f.getName() +" in " + rule.toShortString());