Class DLVSolver

  • All Implemented Interfaces:
    net.sf.tweety.commons.ModelProvider<ASPRule,​Program,​AnswerSet>, net.sf.tweety.commons.QualitativeReasoner<Program,​ASPLiteral>, net.sf.tweety.commons.Reasoner<Boolean,​Program,​ASPLiteral>

    public class DLVSolver
    extends ASPSolver
    Wrapper class for the DLV answer set solver command line utility.
    Author:
    Thomas Vengels, Tim Janus, Anna Gessler
    • Constructor Detail

      • DLVSolver

        public DLVSolver​(String pathToDLV)
        Constructs a new instance pointing to a specific DLV solver.
        Parameters:
        pathToDLV - binary location of DLV on the hard drive
      • DLVSolver

        public DLVSolver​(String pathToDLV,
                         net.sf.tweety.commons.util.Shell bash)
        Constructs a new instance pointing to a specific DLV solver.
        Parameters:
        pathToDLV - binary location of DLV on the hard drive
        bash - shell to run commands
    • Method Detail

      • getModels

        public List<AnswerSet> getModels​(String p)
        Description copied from class: ASPSolver
        Returns a characterizing model (answer set) of the given belief base.
        Specified by:
        getModels in class ASPSolver
        Parameters:
        p - containing belief base
        Returns:
        AnswerSet
      • getModels

        public List<AnswerSet> getModels​(File file)
        Description copied from class: ASPSolver
        Returns a characterizing model (answer set) of the given belief base.
        Specified by:
        getModels in class ASPSolver
        Parameters:
        file - containing belief base
        Returns:
        AnswerSet
      • parseResult

        protected List<AnswerSet> parseResult​(String s)
        Processes a string containing answer sets and returns an AnswerSetList.
        Parameters:
        s - String containing DLV output
        Returns:
        AnswerSet
      • setOptions

        public void setOptions​(String options)
        Set additional command line options for DLV.
        Parameters:
        options - a string of options
      • setPathToDLV

        public void setPathToDLV​(String pathToDLV)
        Sets the location of the DLV solver on the hard drive.
        Parameters:
        pathToDLV - path to DLV
      • query

        public Boolean query​(Program beliefbase,
                             ASPLiteral formula,
                             net.sf.tweety.commons.InferenceMode inferenceMode)