Package net.sf.tweety.logics.pcl.parser
Class PclParser
- java.lang.Object
-
- net.sf.tweety.commons.Parser<PclBeliefSet,ProbabilisticConditional>
-
- net.sf.tweety.logics.pcl.parser.PclParser
-
public class PclParser extends Parser<PclBeliefSet,ProbabilisticConditional>
This class implements a parser for probabilistic conditional logic. The BNF for a conditional knowledge base is given by (starting symbol is KB)
KB ::== (CONDITIONAL "\n")*
CONDITIONAL ::== "(" FORMULA ")" "[" PROB "]" | "(" FORMULA "|" FORMULA ")" "[" PROB "]"
FORMULA ::== PROPOSITION | "(" FORMULA ")" | FORMULA "&&" FORMULA | FORMULA "||" FORMULA | "!" FORMULA | "+" | "-"
where PROPOSITION is a sequence of symbols from {a,...,z,A,...,Z,0,...,9} with a letter at the beginning and PROB is a float in [0,1].- Author:
- Matthias Thimm
-
-
Constructor Summary
Constructors Constructor Description PclParser()
-
Method Summary
Modifier and Type Method Description PclBeliefSet
parseBeliefBase(java.io.Reader reader)
Parses the given reader into a belief base of the given type.ProbabilisticConditional
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 PclBeliefSet 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<PclBeliefSet,ProbabilisticConditional>
- 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 ProbabilisticConditional 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<PclBeliefSet,ProbabilisticConditional>
- Parameters:
reader
- a reader- Returns:
- a formula
- Throws:
java.io.IOException
- if some IO issue occurred.ParserException
- some parsing exceptions may be added here.
-
-