Class RpclParser
java.lang.Object
org.tweetyproject.commons.Parser<RpclBeliefSet,RelationalProbabilisticConditional>
 
org.tweetyproject.logics.rpcl.parser.RpclParser
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].
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 - 
Method Summary
Modifier and TypeMethodDescriptionReturns the signature of this parser.parseBeliefBase(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
- 
RpclParser
public RpclParser()Creates a new RPCL Parser 
 - 
 - 
Method Details
- 
parseBeliefBase
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:
 IOException- if some IO issue occurred.ParserException- some parsing exceptions may be added here.
 - 
parseFormula
public RelationalProbabilisticConditional parseFormula(Reader reader) throws 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:
 IOException- if some IO issue occurred.ParserException- some parsing exceptions may be added here.
 - 
getSignature
Returns the signature of this parser.- Returns:
 - the signature of this parser.
 
 
 -