Class MleanCoPWriter


  • public class MleanCoPWriter
    extends java.lang.Object
    Prints single FOL and modal formulas to the MleanCoP format:

    Negation: '~'
    Conjunction: ','
    Disjunction: ';'
    Implication: '=>'
    Equivalence: '<=>'
    Universal quantifier: 'all X:'
    Existential quantifier: 'ex X:'
    Modal box operator (Necessity): '#'
    Modal diamond operator (Possibility): '*'
    Author:
    Anna Gessler, Nils Geilen
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.io.Writer writer
      Output is redirected to this writer.
    • Constructor Summary

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

      Modifier and Type Method Description
      void close()
      Closes the Writer.
      private java.lang.String parens​(java.lang.String str)
      Puts a string in parentheses.
      private java.lang.String printFormula​(RelationalFormula f)
      Creates a representation of a formula in MleanCoP format.
      void printQuery​(RelationalFormula f)
      Prints the query.
      • Methods inherited from class java.lang.Object

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

      • writer

        final java.io.Writer writer
        Output is redirected to this writer.
    • Constructor Detail

      • MleanCoPWriter

        public MleanCoPWriter​(java.io.Writer writer)
        Creates a new MleanCoPWriter.
        Parameters:
        writer - Output is redirected to this writer.
      • MleanCoPWriter

        public MleanCoPWriter()
        Creates a new MleanCoPWriter.
    • Method Detail

      • printQuery

        public void printQuery​(RelationalFormula f)
                        throws java.io.IOException
        Prints the query.
        Parameters:
        f - the query, a first-order logic or modal formula
        Throws:
        java.io.IOException - if an IO issue occurs.
      • printFormula

        private java.lang.String printFormula​(RelationalFormula f)
        Creates a representation of a formula in MleanCoP format.
        Parameters:
        f - a formula
        Returns:
        a string that represents the formula in MleanCoP format
      • parens

        private java.lang.String parens​(java.lang.String str)
        Puts a string in parentheses.
        Parameters:
        str - a string
        Returns:
        (str)
      • close

        public void close()
                   throws java.io.IOException
        Closes the Writer.
        Throws:
        java.io.IOException - if an IO issue occurs.