Class ActionQueryParser
- java.lang.Object
-
- net.sf.tweety.commons.Parser<SActionQuerySet,SActionQuery>
-
- net.sf.tweety.action.query.parser.ActionQueryParser
-
public class ActionQueryParser extends Parser<SActionQuerySet,SActionQuery>
This class implements a parser for action queries in S. The BNF of such queries is given by: (starting symbol is KB)
KB ::== QUERY1 ("\n" QUERY1)*
QUERY1 ::== QUERY ( "requires" REQUIREMENTS )?
QUERY ::== PROPOSITION | QUERY "&&" QUERY | QUERY "||" QUERY | "!" QUERY | "(" QUERY ")" | "+" | "-"
PROPOSITION ::== HOLDSQUERY | ALWAYSQUERY | NECESSARILYQUERY
HOLDSQUERY ::== "holds" "[" STATEFORMULA "]"
ALWAYSQUERY ::== "always" "[" STATEFORMULA "]"
NECESSARILYQUERY ::== "necessarily" "[" STATEFORMULA "]" "after" ACTIONS
ACTIONS ::== ACTION ( ";" ACTION )*
ACTION ::== "{" ACTIONNAME ("," ACTIONNAME)* "}"
REQUIREMENTS ::== REQUIREMENT ("," REQUIREMENT)*
REQUIREMENT ::== (VARIABLENAME "<>" VARIABLENAME | VARIABLENAME "<>" CONSTANTNAME)*
where STATEFORMULA is an unquantified first-order formula without functors,
and VARIABLENAME, CONSTANTNAME are sequences of symbols
from {a,...,z,A,...,Z,0,...,9} with a letter at the beginning.- Author:
- Sebastian Homann, Tim Janus (change constant LogicalSymbols to dynamic)
-
-
Constructor Summary
Constructors Constructor Description ActionQueryParser(ActionSignature signature)
-
Method Summary
Modifier and Type Method Description SActionQuerySet
parseBeliefBase(java.io.Reader reader)
Parses the given reader into a belief base of the given type.SActionQuery
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
-
-
-
-
Constructor Detail
-
ActionQueryParser
public ActionQueryParser(ActionSignature signature)
-
-
Method Detail
-
parseBeliefBase
public SActionQuerySet parseBeliefBase(java.io.Reader reader)
Description copied from class:Parser
Parses the given reader into a belief base of the given type.- Specified by:
parseBeliefBase
in classParser<SActionQuerySet,SActionQuery>
- Parameters:
reader
- a reader- Returns:
- a belief base
-
parseFormula
public SActionQuery 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<SActionQuerySet,SActionQuery>
- Parameters:
reader
- a reader- Returns:
- a formula
- Throws:
java.io.IOException
- if some IO issue occurred.ParserException
- some parsing exceptions may be added here.
-
-