@Override public Collection<? extends AtomVariable> getBindableVars(final Collection<AtomVariable> bound) { _head = null; for (final AtomDObject obj : _atom.getAllArguments()) if (_head == null) { _head = obj; // Can only bind first argument to tokenize if (!VariableUtils.isVariable(_head)) return Collections.emptySet(); } else // Cannot bind a variable that occurs in multiple places. if (_head.equals(obj)) return Collections.emptySet(); if (_head == null) return Collections.emptySet(); return Collections.singleton((AtomVariable) _head); }
@Override public Collection<? extends AtomVariable> getBindableVars(final Collection<AtomVariable> bound) { AtomDObject head = null; for (final AtomDObject obj : _atom.getAllArguments()) if (head == null) { head = obj; // Can only bind first argument to a _function if (!VariableUtils.isVariable(head)) return Collections.emptySet(); } else // Cannot bind a variable that occurs in multiple places. if (head.equals(obj)) return Collections.emptySet(); if (head == null) return Collections.emptySet(); return Collections.singleton((AtomVariable) head); }
@Override public Collection<? extends AtomVariable> getBindableVars(final Collection<AtomVariable> bound) { AtomDObject head = null; for (final AtomDObject obj : _atom.getAllArguments()) if (head == null) { head = obj; // Can only bind first argument to a _function if (!VariableUtils.isVariable(head)) return Collections.emptySet(); } else // Cannot bind a variable that occurs in multiple places. if (head.equals(obj)) return Collections.emptySet(); if (head == null) return Collections.emptySet(); return Collections.singleton((AtomVariable) head); }
@Override public Collection<? extends AtomVariable> getBindableVars(final Collection<AtomVariable> bound) { _head = null; for (final AtomDObject obj : _atom.getAllArguments()) if (_head == null) { _head = obj; // Can only bind first argument to tokenize if (!VariableUtils.isVariable(_head)) return Collections.emptySet(); } else // Cannot bind a variable that occurs in multiple places. if (_head.equals(obj)) return Collections.emptySet(); if (_head == null) return Collections.emptySet(); return Collections.singleton((AtomVariable) _head); }
@Override public void setCurrentBinding(final VariableBinding currentBinding) { if (VariableUtils.isVariable(_head)) { final ATermAppl resultTerm = ATermUtils.makePlainLiteral(_match); final Literal resultLit = currentBinding.getABox().addLiteral(resultTerm); currentBinding.set(_head, resultLit); } }
@Override public void setCurrentBinding(final VariableBinding currentBinding) { if (VariableUtils.isVariable(_head)) { final ATermAppl resultTerm = ATermUtils.makePlainLiteral(_match); final Literal resultLit = currentBinding.getABox().addLiteral(resultTerm); currentBinding.set(_head, resultLit); } }