Package net.sf.tweety.logics.pl.parser
Class DimacsParser
- java.lang.Object
-
- net.sf.tweety.commons.Parser<PlBeliefSet,PlFormula>
-
- net.sf.tweety.logics.pl.parser.DimacsParser
-
- Direct Known Subclasses:
QdimacsParser
public class DimacsParser extends Parser<PlBeliefSet,PlFormula>
Parser a file in Dimacs format into a PlBeliefSet.- Author:
- Matthias Thimm
-
-
Constructor Summary
Constructors Constructor Description DimacsParser()
-
Method Summary
Modifier and Type Method Description PlBeliefSet
parseBeliefBase(java.io.Reader reader)
Parses the given reader into a belief base of the given type.Disjunction
parseFormula(java.io.Reader reader)
Parses the given reader into a formula of the given type.void
setSignature(PlSignature sig)
Sets the signature of this parser.-
Methods inherited from class net.sf.tweety.commons.Parser
isNumeric, parseBeliefBase, parseBeliefBaseFromFile, parseFormula, parseFormulaFromFile
-
-
-
-
Method Detail
-
setSignature
public void setSignature(PlSignature sig)
Sets the signature of this parser. Note that the natural order of the atoms in the signature (as returned by an iterator) is used for indexing variables in clauses.- Parameters:
sig
- some signature
-
parseBeliefBase
public PlBeliefSet parseBeliefBase(java.io.Reader reader) throws java.io.IOException, ParserException
Description copied from class:Parser
Parses the given reader into a belief base of the given type.- Specified by:
parseBeliefBase
in classParser<PlBeliefSet,PlFormula>
- Parameters:
reader
- a reader- Returns:
- a belief base
- Throws:
java.io.IOException
- if some IO issue occurred.ParserException
- some parsing exceptions may be added here.
-
parseFormula
public Disjunction parseFormula(java.io.Reader reader) throws java.io.IOException, ParserException
Description copied from class:Parser
Parses the given reader into a formula of the given type.- Specified by:
parseFormula
in classParser<PlBeliefSet,PlFormula>
- Parameters:
reader
- a reader- Returns:
- a formula
- Throws:
java.io.IOException
- if some IO issue occurred.ParserException
- some parsing exceptions may be added here.
-
-