Package net.sf.tweety.logics.rpcl.parser
Class RpclParser
- java.lang.Object
 - 
- net.sf.tweety.commons.Parser<RpclBeliefSet,RelationalProbabilisticConditional>
 - 
- net.sf.tweety.logics.rpcl.parser.RpclParser
 
 
 
- 
public class RpclParser extends Parser<RpclBeliefSet,RelationalProbabilisticConditional>
This class implements a parser for relational probabilistic conditional logic. The BNF for a conditional knowledge base is given by (starting symbol is KB)
KB ::== SORTSDEC PREDDECS (CONDITIONAL "\n")*
SORTSDEC ::== ( SORTNAME "=" "{" (CONSTANTNAME ("," CONSTANTNAME)*)? "}" "\n" )*
PREDDECS ::== ( "type" "(" PREDICATENAME "(" (SORTNAME ("," SORTNAME)*)? ")" ")" "\n" )*
CONDITIONAL ::== "(" FORMULA ")" "[" PROB "]" | "(" FORMULA "|" FORMULA ")" "[" PROB "]"
FORMULA ::== ATOM | "(" FORMULA ")" | FORMULA "&&" FORMULA | FORMULA "||" FORMULA | "!" FORMULA | "+" | "-"
ATOM ::== PREDICATENAME "(" (TERM ("," TERM)*)? ")"
TERM ::== VARIABLENAME | CONSTANTNAME
where SORTNAME, PREDICATENAME, CONSTANTNAME, and VARIABLENAME are sequences 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 RpclParser()Creates a new RPCL Parser 
- 
Method Summary
Modifier and Type Method Description FolSignaturegetSignature()Returns the signature of this parser.RpclBeliefSetparseBeliefBase(java.io.Reader reader)Parses the given reader into a belief base of the given type.RelationalProbabilisticConditionalparseFormula(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 
 - 
 
 - 
 
- 
- 
Field Detail
- 
folParser
private FolParser folParser
For parsing FOL fragments. 
 - 
 
- 
Method Detail
- 
parseBeliefBase
public RpclBeliefSet parseBeliefBase(java.io.Reader reader) throws java.io.IOException, ParserException
Description copied from class:ParserParses the given reader into a belief base of the given type.- Specified by:
 parseBeliefBasein classParser<RpclBeliefSet,RelationalProbabilisticConditional>- 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 RelationalProbabilisticConditional parseFormula(java.io.Reader reader) throws java.io.IOException, ParserException
Description copied from class:ParserParses the given reader into a formula of the given type.- Specified by:
 parseFormulain classParser<RpclBeliefSet,RelationalProbabilisticConditional>- Parameters:
 reader- a reader- Returns:
 - a formula
 - Throws:
 java.io.IOException- if some IO issue occurred.ParserException- some parsing exceptions may be added here.
 
- 
getSignature
public FolSignature getSignature()
Returns the signature of this parser.- Returns:
 - the signature of this parser.
 
 
 - 
 
 -