Class TuPrologQuery


  • public class TuPrologQuery
    extends Query
    The tuProlog implementation of the Query class.
    • Method Detail

      • solve

        public <A> Solution<A> solve​(Object... actualArgs)
        Description copied from class: Query
        Solves the Prolog goal and returns an object using which the individual solutions can be iterated over. The actual arguments will be bound to the placeholders before solving the goal.
        Specified by:
        solve in class Query
        Type Parameters:
        A - the type of an element of the solutions
        Parameters:
        actualArgs - the actual arguments of the goal
        Returns:
        an object for traversing the solutions
      • bind

        public Query bind​(int argument,
                          Object value)
        Description copied from class: Query
        Binds a value to the specified argument of the goal. The argument is specified by its position. Numbering starts from zero.

        The method returns the same query instance.

        Specified by:
        bind in class Query
        Parameters:
        argument - the number of the argument of the goal
        value - the value to be bound to the argument
        Returns:
        the same query instance
      • bind

        public Query bind​(String variable,
                          Object value)
        Description copied from class: Query
        Binds a value to the specified argument of the goal. The argument is specified by its name.
        Specified by:
        bind in class Query
        Parameters:
        variable - the name of the variable of the goal
        value - the value to be bound to the variable
        Returns:
        the same query instance