Package net.sf.tweety.logics.qbf.parser
Class QbfParser
- java.lang.Object
-
- net.sf.tweety.commons.Parser<PlBeliefSet,PlFormula>
-
- net.sf.tweety.logics.pl.parser.PlParser
-
- net.sf.tweety.logics.qbf.parser.QbfParser
-
public class QbfParser extends PlParser
This class implements a parser for quantified boolean formulas. The BNF for a qbf belief set is given by (starting symbol is KB)
KB ::== VARDECLAR FORMULAS
VARDECLAR ::== "{" (VARIABLENAME ("," VARIABLENAME)*)? "}"
FORMULAS ::== FORMULA ( "\n" FORMULA )*
FORMULA ::== VARIABLENAME | "(" FORMULA ")" | FORMULA ">>" FORMULA | FORMULA "||" FORMULA | FORMULA "=>" FORMULA | FORMULA "<=>" FORMULA | "!" FORMULA | "+" | "-" | "forall" VARIABLENAME ":" "(" FORMULA ")" | "exists" VARIABLENAME ":" "(" FORMULA ")" |
VARIABLENAME is a sequence of characters excluding |,&,!,(,),=,<,> and whitespace characters.- Author:
- Anna Gessler, Matthias Thimm
-
-
Constructor Summary
Constructors Constructor Description QbfParser()
-
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.PlFormula
parseFormula(java.io.Reader reader)
Parses the given reader into a formula of the given type.-
Methods inherited from class net.sf.tweety.commons.Parser
isNumeric, parseBeliefBase, parseBeliefBaseFromFile, parseFormula, parseFormulaFromFile
-
-
-
-
Method Detail
-
parseBeliefBase
public PlBeliefSet parseBeliefBase(java.io.Reader reader) throws ParserException
Description copied from class:Parser
Parses the given reader into a belief base of the given type.- Overrides:
parseBeliefBase
in classPlParser
- Parameters:
reader
- a reader- Returns:
- a belief base
- Throws:
ParserException
- some parsing exceptions may be added here.
-
parseFormula
public PlFormula parseFormula(java.io.Reader reader) throws ParserException
Description copied from class:Parser
Parses the given reader into a formula of the given type.- Overrides:
parseFormula
in classPlParser
- Parameters:
reader
- a reader- Returns:
- a formula
- Throws:
ParserException
- some parsing exceptions may be added here.
-
-