Interface Atom

    • Method Detail

      • getName

        java.lang.String getName()
        Returns:
        the name of the predicate
      • getPredicate

        Predicate getPredicate()
        Returns:
        the predicate of the atom
      • setPredicate

        Atom.RETURN_SET_PREDICATE setPredicate​(Predicate predicate)
        Changes the predicate of the atom. Given an old Predicate po and a new predicate pn with their list of arguments types at(po) and at(pn) and the arguments of this Atom: arg(this) this method distinguishes between three cases: 1. The predicate only differ in the names, returning RSP_SUCCESS 2. The old predicates argument types is a sub-list of the new argument types then the method returns RSP_INCOMPLETE and the atoms isComplete() method returns false 3. The new predicates argument types is a sub-list of the old argument types then the method returns RSP_TRUNCATED and the arguments of this atom are truncated too and isComplete() returns true. 4. The old and new predicates' argument types differ then the list of arguments of the atom get cleared and isComplete() returns false.
        Parameters:
        predicate - some predicate
        Returns:
        Depends on the cases described above: 1. RSP_SUCCESS 2. RSP_INCOMPLETE 3. RSP_TRUNCATED 4. RSP_CLEARED
      • addArgument

        void addArgument​(Term<?> arg)
                  throws LanguageException
        Adds an argument to the atom's argument list
        Parameters:
        arg - The next argument
        Throws:
        LanguageException - If the language does not support arguments for their constructs.
      • getArguments

        java.util.List<? extends Term<?>> getArguments()
        Returns:
        A list containing all the arguments of this specific atom
      • isComplete

        boolean isComplete()
        Returns:
        true if the size of the argument list is equal to the arity of the predicate