- java.lang.Object
-
- org.logicng.io.parsers.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 org.logicng.formulas.FormulareadPropositionalFormula(File file, org.logicng.formulas.FormulaFactory f)Reads a given file and returns the contained propositional formula.static org.logicng.formulas.FormulareadPropositionalFormula(String fileName, org.logicng.formulas.FormulaFactory f)Reads a given file and returns the contained propositional formula.static org.logicng.formulas.FormulareadPseudoBooleanFormula(File file, org.logicng.formulas.FormulaFactory f)Reads a given file and returns the contained pseudo-Boolean formula.static org.logicng.formulas.FormulareadPseudoBooleanFormula(String fileName, org.logicng.formulas.FormulaFactory f)Reads a given file and returns the contained pseudo-Boolean formula.
-
-
-
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 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 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 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 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 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 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 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
-
-