Class QdimacsWriter


  • public class QdimacsWriter
    extends java.lang.Object
    Converts belief bases to QDIMACS format and prints them.

    Notes:
    - Currently only works for belief bases that have only quantifiers in the left portion of each formula and have only unquantified formulas in the right portion of each formula.
    - The right portion of the formulas does not need to be in any special form (it will be converted to cnf).
    Author:
    Anna Gessler
    • Field Summary

      Fields 
      Modifier and Type Field Description
      boolean DISABLE_PREAMBLE_ZERO
      Removes zero at the end of the problem line (workaround for some solvers).
      (package private) java.io.Writer writer
      Output is redirected to this writer
    • Constructor Summary

      Constructors 
      Constructor Description
      QdimacsWriter()
      Creates a new QDIMACS writer.
      QdimacsWriter​(java.io.Writer writer)
      Creates a new QDIMACS writer.
    • Method Summary

      Modifier and Type Method Description
      void close()  
      java.lang.String printBase​(PlBeliefSet kb)  
      java.lang.String printVariables​(java.util.Set<Proposition> vars, java.util.Map<Proposition,​java.lang.Integer> mappings)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • writer

        java.io.Writer writer
        Output is redirected to this writer
      • DISABLE_PREAMBLE_ZERO

        public boolean DISABLE_PREAMBLE_ZERO
        Removes zero at the end of the problem line (workaround for some solvers).
    • Constructor Detail

      • QdimacsWriter

        public QdimacsWriter​(java.io.Writer writer)
        Creates a new QDIMACS writer.
        Parameters:
        writer -
      • QdimacsWriter

        public QdimacsWriter()
        Creates a new QDIMACS writer.
    • Method Detail

      • printBase

        public java.lang.String printBase​(PlBeliefSet kb)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • printVariables

        public java.lang.String printVariables​(java.util.Set<Proposition> vars,
                                               java.util.Map<Proposition,​java.lang.Integer> mappings)
      • close

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