Package org.prolog4j

Class AbstractProver

    • Constructor Detail

    • Method Detail

      • solve

        public final <A> Solution<A> solve​(String goal,
                                           Object... actualArgs)
        Description copied from interface: Prover
        Solves a Prolog goal and returns an object using which the individual solutions can be iterated over. It is equivalent with the following: query(goal).solve(actualArgs)
        Specified by:
        solve in interface Prover
        Type Parameters:
        A - the type of an element of the solutions
        Parameters:
        goal - the Prolog goal
        actualArgs - the actual arguments of the goal
        Returns:
        an object for traversing the solutions
        See Also:
        Query.solve(Object...)
      • assertz

        public void assertz​(String fact,
                            Object... args)
        Description copied from interface: Prover
        Asserts a Prolog fact or rule to the knowledge base.
        Specified by:
        assertz in interface Prover
        Parameters:
        fact - the Prolog fact
        args - the arguments of the fact
      • retract

        public void retract​(String fact)
        Description copied from interface: Prover
        Retracts a Prolog fact or rule from the knowledge base.
        Specified by:
        retract in interface Prover
        Parameters:
        fact - the Prolog fact
      • loadTheory

        public void loadTheory​(String input)
        Description copied from interface: Prover
        Loads a Prolog theory from a string.
        Specified by:
        loadTheory in interface Prover
        Parameters:
        input - the string
      • getConversionPolicy

        public ConversionPolicy getConversionPolicy()
        Description copied from interface: Prover
        Returns the conversion policy used by the prover.
        Specified by:
        getConversionPolicy in interface Prover
        Returns:
        the conversion policy