Package net.sf.tweety.logics.qbf.parser
Class QCirParser
- java.lang.Object
-
- net.sf.tweety.commons.Parser<net.sf.tweety.logics.pl.syntax.PlBeliefSet,net.sf.tweety.logics.pl.syntax.PlFormula>
-
- net.sf.tweety.logics.qbf.parser.QCirParser
-
public class QCirParser extends net.sf.tweety.commons.Parser<net.sf.tweety.logics.pl.syntax.PlBeliefSet,net.sf.tweety.logics.pl.syntax.PlFormula>This class implements a parser for the QCIR (Quantified CIRcuit) format. See http://www.qbflib.org/qcir.pdf for more information.
The BNF for a QCir file is given by (starting symbol is QCIR-FILE):
QCIR-FILE ::== FORMAT-ID QBLOCK-STMT OUTPUT-STMT (GATE-STMT)*
FORMAT-ID ::== "#QCIR-G14" [INTEGER] "\n"
QBLOCK-STMT ::== ["free(" VAR-LIST ")\n"] QBLOCK-QUANT*
QBLOCK-QUANT ::== QUANT "(" VAR-LIST ")"\n"
VAR-LIST ::== (VAR,)* VAR
LIT-LIST ::== (LIT,)* LIT
OUTPUT-STMT ::== "output(" LIT ")\n"
GATE-STMT ::== GVAR "=" "and" "(" LIT-LIST ")" | GVAR "=" "or" "(" LIT-LIST ")" | GVAR "=" "xor(" LIT "," LIT ")" | GVAR "=" "ite(" LIT "," LIT "," LIT ")" | GVAR = QUANT "(" VAR-LIST ";" LIT ")"
QUANT ::== "exists" | "forall"
LIT ::== VAR | "-" VAR | GVAR | "-" GVAR
ite stands for if-then-else.
INTEGER are integer numbers.
VAR and GVAR are sequences of characters of symbols from {a,...,z,A,...,Z,0,...,9,_}.
Additionally, lines starting with "#" (comments) will be ignored.- Author:
- Anna Gessler
-
-
Constructor Summary
Constructors Constructor Description QCirParser()
-
Method Summary
Modifier and Type Method Description net.sf.tweety.logics.pl.syntax.PlFormulagetOutputVariable()net.sf.tweety.logics.pl.syntax.PlBeliefSetparseBeliefBase(Reader reader)net.sf.tweety.logics.pl.syntax.PlFormulaparseFormula(Reader reader)
-
-
-
Method Detail
-
getOutputVariable
public net.sf.tweety.logics.pl.syntax.PlFormula getOutputVariable()
- Returns:
- the output gate of this QCir problem.
-
parseBeliefBase
public net.sf.tweety.logics.pl.syntax.PlBeliefSet parseBeliefBase(Reader reader) throws IOException, net.sf.tweety.commons.ParserException
- Specified by:
parseBeliefBasein classnet.sf.tweety.commons.Parser<net.sf.tweety.logics.pl.syntax.PlBeliefSet,net.sf.tweety.logics.pl.syntax.PlFormula>- Throws:
IOExceptionnet.sf.tweety.commons.ParserException
-
parseFormula
public net.sf.tweety.logics.pl.syntax.PlFormula parseFormula(Reader reader) throws IOException, net.sf.tweety.commons.ParserException
- Specified by:
parseFormulain classnet.sf.tweety.commons.Parser<net.sf.tweety.logics.pl.syntax.PlBeliefSet,net.sf.tweety.logics.pl.syntax.PlFormula>- Throws:
IOExceptionnet.sf.tweety.commons.ParserException
-
-