Class ClingoWriter


  • public class ClingoWriter
    extends java.lang.Object
    Prints ASP programs and single rules to the Clingo input format (https://potassco.org/clingo/). The Clingo input format adheres (mostly) to the ASP-Core-2 language standard. This writer also works for printing basic elements of the DLV input format.
    Author:
    Anna Gessler
    See Also:
    ClingoSolver, DLVSolver
    • Constructor Summary

      Constructors 
      Constructor Description
      ClingoWriter()
      Create a new ClingoWriter.
      ClingoWriter​(java.io.Writer writer)
      Create a new ClingoWriter with the given writer.
      ClingoWriter​(java.io.Writer writer, boolean usePredicateWhitelist)
      Create a new ClingoWriter with the given writer and options.
    • Method Summary

      Modifier and Type Method Description
      void close()  
      void printProgram​(Program p)
      Prints the given program in clingo format.
      void usePredicateWhitelist​(boolean b)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClingoWriter

        public ClingoWriter​(java.io.Writer writer)
        Create a new ClingoWriter with the given writer.
        Parameters:
        writer - a writer
      • ClingoWriter

        public ClingoWriter()
        Create a new ClingoWriter.
      • ClingoWriter

        public ClingoWriter​(java.io.Writer writer,
                            boolean usePredicateWhitelist)
        Create a new ClingoWriter with the given writer and options.
        Parameters:
        writer -
        usePredicateWhitelist - if set to true, irrelevant atoms are hidden from the output using clingo's #show statement.
    • Method Detail

      • printProgram

        public void printProgram​(Program p)
                          throws java.io.IOException
        Prints the given program in clingo format.
        Parameters:
        p - a program
        Throws:
        java.io.IOException - if an IO issue occurs.
      • close

        public void close()
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • usePredicateWhitelist

        public void usePredicateWhitelist​(boolean b)