Class FormulaReader


  • public final class FormulaReader
    extends Object
    A reader for formulas.

    Reads a formula from an input file. If the file has more than one line, the lines will be co-joined.

    Since:
    1.2
    Version:
    1.2
    • Method Detail

      • readPropositionalFormula

        public static org.logicng.formulas.Formula readPropositionalFormula​(String fileName,
                                                                            org.logicng.formulas.FormulaFactory f)
                                                                     throws IOException,
                                                                            ParserException
        Reads a given file and returns the contained propositional formula.
        Parameters:
        fileName - the file name
        f - the formula factory
        Returns:
        the parsed formula
        Throws:
        IOException - if there was a problem reading the file
        ParserException - if there was a problem parsing the formula
      • readPropositionalFormula

        public static org.logicng.formulas.Formula readPropositionalFormula​(File file,
                                                                            org.logicng.formulas.FormulaFactory f)
                                                                     throws IOException,
                                                                            ParserException
        Reads a given file and returns the contained propositional formula.
        Parameters:
        file - the file
        f - the formula factory
        Returns:
        the parsed formula
        Throws:
        IOException - if there was a problem reading the file
        ParserException - if there was a problem parsing the formula
      • readPseudoBooleanFormula

        public static org.logicng.formulas.Formula readPseudoBooleanFormula​(String fileName,
                                                                            org.logicng.formulas.FormulaFactory f)
                                                                     throws IOException,
                                                                            ParserException
        Reads a given file and returns the contained pseudo-Boolean formula.
        Parameters:
        fileName - the file name
        f - the formula factory
        Returns:
        the parsed formula
        Throws:
        IOException - if there was a problem reading the file
        ParserException - if there was a problem parsing the formula
      • readPseudoBooleanFormula

        public static org.logicng.formulas.Formula readPseudoBooleanFormula​(File file,
                                                                            org.logicng.formulas.FormulaFactory f)
                                                                     throws IOException,
                                                                            ParserException
        Reads a given file and returns the contained pseudo-Boolean formula.
        Parameters:
        file - the file
        f - the formula factory
        Returns:
        the parsed formula
        Throws:
        IOException - if there was a problem reading the file
        ParserException - if there was a problem parsing the formula