Class QbfParser
java.lang.Object
org.tweetyproject.commons.Parser<PlBeliefSet,PlFormula>
org.tweetyproject.logics.pl.parser.PlParser
org.tweetyproject.logics.qbf.parser.QbfParser
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.
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
-
Method Summary
Modifier and TypeMethodDescriptionparseBeliefBase
(Reader reader) Parses the given reader into a belief base of the given type.parseFormula
(Reader reader) Parses the given reader into a formula of the given type.Methods inherited from class org.tweetyproject.commons.Parser
isNumeric, parseBeliefBase, parseBeliefBaseFromFile, parseFormula, parseFormulaFromFile, parseListOfBeliefBases, parseListOfBeliefBases, parseListOfBeliefBasesFromFile, parseListOfBeliefBasesFromFile
-
Constructor Details
-
QbfParser
public QbfParser()Default
-
-
Method Details
-
parseBeliefBase
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
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.
-