/** * Return a short-form description of this derivation. */ @Override public String toString() { if (rule == null) { return "DUMMY"; } else { return "Rule " + rule.toShortString(); } }
/** * Return a short-form description of this derivation. */ @Override public String toString() { if (rule == null) { return "DUMMY"; } else { return "Rule " + rule.toShortString(); } }
/** * Constructor. * @param msg a free-text message describing the problem * @param cause a nested exception which prompted this error */ public LPRuleSyntaxException(String msg, Rule rule, Throwable cause) { super("Syntax error in backward rule: " + rule.toShortString() +"\n" + msg, cause); } }
/** * Constructor. * @param msg a free-text message describing the problem */ public LPRuleSyntaxException(String msg, Rule rule) { super("Syntax error in backward rule: " + rule.toShortString() +"\n" + msg); }
/** * Printable string for debugging. */ @Override public String toString() { if (clause == null || clause.rule == null) { return "[anon]"; } else { return "[" + clause.rule.toShortString() + "]"; } } }
/** * Print clause as rule for tracing. */ @Override public String toString() { if (rule == null) { return "[anon]"; } else { return "[" + rule.toShortString() + "]"; } }
/** * Constructor. * @param msg a free-text message describing the problem * @param cause a nested exception which prompted this error */ public LPRuleSyntaxException(String msg, Rule rule, Throwable cause) { super("Syntax error in backward rule: " + rule.toShortString() +"\n" + msg, cause); } }
/** * Print clause as rule for tracing. */ @Override public String toString() { if (rule == null) { return "[anon]"; } else { return "[" + rule.toShortString() + "]"; } }
/** * Constructor. * @param msg a free-text message describing the problem */ public LPRuleSyntaxException(String msg, Rule rule) { super("Syntax error in backward rule: " + rule.toShortString() +"\n" + msg); }
/** * Printable string for debugging. */ @Override public String toString() { if (clause == null || clause.rule == null) { return "[anon]"; } else { return "[" + clause.rule.toShortString() + "]"; } } }
/** * Deletes a new Backward rule as a rules of a forward rule process. Only some * infgraphs support this. */ @Override public void deleteBRule(Rule brule) { throw new ReasonerException("Forward reasoner does not support hybrid rules - " + brule.toShortString()); }
/** * Deletes a new Backward rule as a rules of a forward rule process. Only some * infgraphs support this. */ @Override public void deleteBRule(Rule brule) { throw new ReasonerException("Forward reasoner does not support hybrid rules - " + brule.toShortString()); }
/** * Adds a new Backward rule as a rules of a forward rule process. Only some * infgraphs support this. */ @Override public void addBRule(Rule brule) { throw new ReasonerException("Forward reasoner does not support hybrid rules - " + brule.toShortString()); }
/** * Adds a new Backward rule as a rules of a forward rule process. Only some * infgraphs support this. */ @Override public void addBRule(Rule brule) { throw new ReasonerException("Forward reasoner does not support hybrid rules - " + brule.toShortString()); }
/** * Add a triple to the stack of triples to waiting to be processed by the rule engine. */ public void addTriple(Triple t) { if (graph.shouldTrace()) { if (rule != null) { logger.debug("Adding to stack (" + rule.toShortString() + "): " + PrintUtil.print(t)); } else { logger.debug("Adding to stack : " + PrintUtil.print(t)); } } stack.add(t); }
/** * Constructor. * @param builtin the invoking builtin * @param context the invoking rule context * @param message a text explanation of the error */ public BuiltinException(Builtin builtin, RuleContext context, String message) { super("Error in clause of rule (" + context.getRule().toShortString() + ") " + builtin.getName() + ": " + message); } }
/** * Add a triple to the stack of triples to waiting to be processed by the rule engine. */ public void addTriple(Triple t) { if (graph.shouldTrace()) { if (rule != null) { logger.debug("Adding to stack (" + rule.toShortString() + "): " + PrintUtil.print(t)); } else { logger.debug("Adding to stack : " + PrintUtil.print(t)); } } stack.add(t); }
/** * Constructor. * @param builtin the invoking builtin * @param context the invoking rule context * @param message a text explanation of the error */ public BuiltinException(Builtin builtin, RuleContext context, String message) { super("Error in clause of rule (" + context.getRule().toShortString() + ") " + builtin.getName() + ": " + message); } }
/** * 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); }