use of edu.cmu.ml.proppr.prove.wam.plugins.builtin.PluginFunction in project ProPPR by TeamCohen.
the class ProofGraph method addBuiltinPlugins.
private WamPlugin[] addBuiltinPlugins(WamPlugin... plugins) {
WamPlugin[] result = Arrays.copyOf(plugins, plugins.length + 1);
FilterPluginCollection filters = new FilterPluginCollection(this.apr);
result[plugins.length] = filters;
filters.register("neq/2", new PluginFunction() {
@Override
public boolean run(WamInterpreter wamInterp) throws LogicProgramException {
String arg1 = wamInterp.getConstantArg(2, 1);
String arg2 = wamInterp.getConstantArg(2, 2);
if (arg1 == null || arg2 == null)
throw new LogicProgramException("cannot call neq/2 unless both variables are bound");
return arg1 != arg2;
}
});
return result;
}
Aggregations