- java.lang.Object
-
- org.logicng.io.readers.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 Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FormulareadPropositionalFormula(File file, FormulaFactory f)Reads a given file and returns the contained propositional formula.static FormulareadPropositionalFormula(String fileName, FormulaFactory f)Reads a given file and returns the contained propositional formula.static FormulareadPseudoBooleanFormula(File file, FormulaFactory f)Reads a given file and returns the contained pseudo-Boolean formula.static FormulareadPseudoBooleanFormula(String fileName, FormulaFactory f)Reads a given file and returns the contained pseudo-Boolean formula.
-
-
-
Method Detail
-
readPropositionalFormula
public static Formula readPropositionalFormula(String fileName, FormulaFactory f) throws IOException, ParserException
Reads a given file and returns the contained propositional formula.- Parameters:
fileName- the file namef- the formula factory- Returns:
- the parsed formula
- Throws:
IOException- if there was a problem reading the fileParserException- if there was a problem parsing the formula
-
readPropositionalFormula
public static Formula readPropositionalFormula(File file, FormulaFactory f) throws IOException, ParserException
Reads a given file and returns the contained propositional formula.- Parameters:
file- the filef- the formula factory- Returns:
- the parsed formula
- Throws:
IOException- if there was a problem reading the fileParserException- if there was a problem parsing the formula
-
readPseudoBooleanFormula
public static Formula readPseudoBooleanFormula(String fileName, FormulaFactory f) throws IOException, ParserException
Reads a given file and returns the contained pseudo-Boolean formula.- Parameters:
fileName- the file namef- the formula factory- Returns:
- the parsed formula
- Throws:
IOException- if there was a problem reading the fileParserException- if there was a problem parsing the formula
-
readPseudoBooleanFormula
public static Formula readPseudoBooleanFormula(File file, FormulaFactory f) throws IOException, ParserException
Reads a given file and returns the contained pseudo-Boolean formula.- Parameters:
file- the filef- the formula factory- Returns:
- the parsed formula
- Throws:
IOException- if there was a problem reading the fileParserException- if there was a problem parsing the formula
-
-