Class SWIPrologProver

  • All Implemented Interfaces:
    Serializable, Prover

    public class SWIPrologProver
    extends AbstractProver
    Represents a Prolog knowledge base and provides methods for solving queries on it. The prover itself is not responsible for processing the solutions.
    See Also:
    Serialized Form
    • Constructor Detail

      • SWIPrologProver

        public SWIPrologProver​(ConversionPolicy conversionPolicy)
        Creates an SWI-Prolog prover.
    • Method Detail

      • query

        public Query query​(String goal)
        Description copied from interface: Prover
        Creates a Prolog query that can be solved later.
        Parameters:
        goal - the Prolog goal
        Returns:
        a query object to be solved later
      • loadLibrary

        public void loadLibrary​(String className)
        Description copied from interface: Prover
        Loads in a Prolog library of the specified name.
        Parameters:
        className - the name of the library
      • loadTheory

        public void loadTheory​(String filename)
        Description copied from interface: Prover
        Loads a Prolog theory from a string.
        Specified by:
        loadTheory in interface Prover
        Overrides:
        loadTheory in class AbstractProver
        Parameters:
        filename - the string
      • addTheory

        public void addTheory​(String theory)
        Description copied from interface: Prover
        Adds a Prolog theory to the knowledge base.
        Parameters:
        theory - the Prolog theory
      • addTheory

        public void addTheory​(String... theory)
        Description copied from interface: Prover
        Adds a Prolog theory to the knowledge base. The elements of the arguments must represent individual Prolog facts and rules.
        Parameters:
        theory - the Prolog theory